예제 #1
0
 private void UpdateTextValue(string value, AutoSuggestionBoxTextChangeReason reason = AutoSuggestionBoxTextChangeReason.ProgrammaticChange)
 {
     if (Text != value)
     {
         m_textChangeReason = reason;
         SetCurrentValue(TextProperty, value);
         m_textChangeReason = null;
     }
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="AutoSuggestBoxTextChangedEventArgs"/> class.
 /// </summary>
 /// <param name="reason"></param>
 public AutoSuggestBoxTextChangedEventArgs(AutoSuggestionBoxTextChangeReason reason)
 {
     Reason = reason;
 }
 /// <summary>
 /// Sets a value that indicates the reason for the text changing in the AutoSuggestBox.
 /// </summary>
 /// <param name="e">The requested <see cref="AutoSuggestBoxTextChangedEventArgs"/>.</param>
 /// <param name="reason">The reason for the text changing in the AutoSuggestBox.</param>
 public static void Reason(this AutoSuggestBoxTextChangedEventArgs e, AutoSuggestionBoxTextChangeReason reason) => Resolver.Reason(e, reason);
 void IAutoSuggestBoxTextChangedEventArgsResolver.Reason(AutoSuggestBoxTextChangedEventArgs e, AutoSuggestionBoxTextChangeReason reason) => e.Reason = reason;
 internal AutoSuggestBoxTextChangedEventArgs(AutoSuggestBox source, string value, AutoSuggestionBoxTextChangeReason reason)
 {
     m_source = new WeakReference <AutoSuggestBox>(source);
     m_value  = value;
     Reason   = reason;
 }