private bool TextChange(TextChangedType type, string text)
        {
            var e = new PreviewTextChangedEventArgs(PreviewTextChangedEvent, type, text);

            OnPreviewTextChanged(e);
            return(e.Handled);
        }
Exemple #2
0
 /// <summary>
 /// Constructor for PreviewTextChangedEventArgs.
 /// </summary>
 /// <param name="routedEvent">The routed event identifier for this instance.</param>
 /// <param name="type">The type of text change that will occur.</param>
 /// <param name="text">The new value of the text.</param>
 public PreviewTextChangedEventArgs(
     RoutedEvent routedEvent,
     TextChangedType type,
     string text)
     : base(routedEvent)
 {
     Type = type;
     Text = text;
 }
        /// <summary>
        /// Change text.
        /// </summary>
        /// <param name="type">The type of text change that will occur.</param>
        /// <param name="text">The new value of the text.</param>
        /// <returns>A value indicating if the event was handled.</returns>
        private bool textChange(TextChangedType type, string text)
        {
            // Raise the PreviewTextChanged event
            PreviewTextChangedEventArgs e = new PreviewTextChangedEventArgs(PreviewTextChangedEvent, type, text);

            OnPreviewTextChanged(e);
            // Return a value indicating if the event was handled
            return(e.Handled);
        }
Exemple #4
0
 /// <summary>
 /// Constructor for PreviewTextChangedEventArgs.
 /// </summary>
 /// <param name="routedEvent">The routed event identifier for this instance.</param>
 /// <param name="source">An alternative source that will be reported when this event is handled.</param>
 /// <param name="type">The type of text change that will occur.</param>
 /// <param name="text">The new value of the text.</param>
 public PreviewTextChangedEventArgs(
     RoutedEvent routedEvent,
     object source,
     TextChangedType type,
     string text)
     : base(routedEvent, source)
 {
     Type = type;
     Text = text;
 }
 private void TextChange(RoutedEventArgs e, TextChangedType type, string text)
 {
     if (Text == text)
     {
         return;
     }
     if (TextChange(type, text))
     {
         e.Handled = true;
     }
 }
 /// <summary>
 /// Change text.
 /// </summary>
 /// <param name="e">The event that triggered the change.</param>
 /// <param name="type">The type of text change that will occur.</param>
 /// <param name="text">The new value of the text.</param>
 private void textChange(RoutedEventArgs e, TextChangedType type, string text)
 {
     // If no change, just return
     if (Text == text)
     {
         return;
     }
     // If this event was handled, handle the triggering event
     if (textChange(type, text))
     {
         e.Handled = true;
     }
 }
 public PreviewTextChangedEventArgs(RoutedEvent routedEvent, object source, TextChangedType type, string text)
     : base(routedEvent, source)
 {
     Type = type;
     Text = text;
 }
 public PreviewTextChangedEventArgs(RoutedEvent routedEvent, TextChangedType type, string text)
     : base(routedEvent)
 {
     Type = type;
     Text = text;
 }
 private bool TextChange(TextChangedType type, string text)
 {
     var e = new PreviewTextChangedEventArgs(PreviewTextChangedEvent, type, text);
     OnPreviewTextChanged(e);
     return e.Handled;
 }
 private void TextChange(RoutedEventArgs e, TextChangedType type, string text)
 {
     if (Text == text)
         return;
     if (TextChange(type, text))
         e.Handled = true;
 }