Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ModernWpf.Controls/AutoSuggestBox/AutoSuggestBox.cs
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ private void OnDelayTimerTick(object sender, EventArgs e)
if (m_delayTimer.Tag is AutoSuggestionBoxTextChangeReason reason)
{
m_delayTimer.Tag = null;
TextChanged?.Invoke(this, new AutoSuggestBoxTextChangedEventArgs(this, Text) { Reason = reason });
TextChanged?.Invoke(this, new AutoSuggestBoxTextChangedEventArgs(this, Text, reason));
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
using System.Windows;
using System;

namespace ModernWpf.Controls
{
public sealed class AutoSuggestBoxQuerySubmittedEventArgs : DependencyObject
public sealed class AutoSuggestBoxQuerySubmittedEventArgs : EventArgs
{
public AutoSuggestBoxQuerySubmittedEventArgs()
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
using System.Windows;
using System;

namespace ModernWpf.Controls
{
public sealed class AutoSuggestBoxSuggestionChosenEventArgs : DependencyObject
public sealed class AutoSuggestBoxSuggestionChosenEventArgs : EventArgs
{
public AutoSuggestBoxSuggestionChosenEventArgs()
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System;
using System.Windows;

namespace ModernWpf.Controls
{
Expand All @@ -10,35 +9,21 @@ public enum AutoSuggestionBoxTextChangeReason
SuggestionChosen = 2
}

public sealed class AutoSuggestBoxTextChangedEventArgs : DependencyObject
public sealed class AutoSuggestBoxTextChangedEventArgs : EventArgs
{
public AutoSuggestBoxTextChangedEventArgs()
{
}

internal AutoSuggestBoxTextChangedEventArgs(AutoSuggestBox source, string value)
internal AutoSuggestBoxTextChangedEventArgs(AutoSuggestBox source, string value, AutoSuggestionBoxTextChangeReason reason)
{
m_source = new WeakReference<AutoSuggestBox>(source);
m_value = value;
Reason = reason;
}

#region Reason

public static readonly DependencyProperty ReasonProperty =
DependencyProperty.Register(
nameof(Reason),
typeof(AutoSuggestionBoxTextChangeReason),
typeof(AutoSuggestBoxTextChangedEventArgs),
new PropertyMetadata(AutoSuggestionBoxTextChangeReason.ProgrammaticChange));

public AutoSuggestionBoxTextChangeReason Reason
{
get => (AutoSuggestionBoxTextChangeReason)GetValue(ReasonProperty);
set => SetValue(ReasonProperty, value);
}

#endregion


public AutoSuggestionBoxTextChangeReason Reason { get; }

public bool CheckCurrent()
{
return m_source != null &&
Expand Down