Handler object type for the AutoTabOnMaxLength property.
コード例 #1
0
        /// <summary>
        /// Handles changes to the AutoTabOnMaxLength property.
        /// </summary>
        /// <param name="d">
        /// The <see cref="DependencyObject"/> on which
        /// the property has changed value.
        /// </param>
        /// <param name="e">
        /// Event data that is issued by any event that
        /// tracks changes to the effective value of this property.
        /// </param>
        private static void OnAutoTabOnMaxLengthChanged(
            DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            bool newAutoTabOnMaxLength = (bool)d.GetValue(AutoTabOnMaxLengthProperty);
            var handler = GetAutoTabOnMaxLengthHandler(d);

            if (handler != null)
            {
                handler.Detach();
                SetAutoTabOnMaxLengthHandler(d, null);
            }

            if (newAutoTabOnMaxLength)
            {
                handler = new AutoTabOnMaxLengthHandler((TextBox)d);
                SetAutoTabOnMaxLengthHandler(d, handler);
            }
        }
コード例 #2
0
        /// <summary>
        /// Handles changes to the AutoTabOnMaxLength property.
        /// </summary>
        /// <param name="d">
        /// The <see cref="DependencyObject"/> on which
        /// the property has changed value.
        /// </param>
        /// <param name="e">
        /// Event data that is issued by any event that
        /// tracks changes to the effective value of this property.
        /// </param>
        private static void OnAutoTabOnMaxLengthChanged(
            DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            bool newAutoTabOnMaxLength = (bool)d.GetValue(AutoTabOnMaxLengthProperty);
            var  handler = GetAutoTabOnMaxLengthHandler(d);

            if (handler != null)
            {
                handler.Detach();
                SetAutoTabOnMaxLengthHandler(d, null);
            }

            if (newAutoTabOnMaxLength)
            {
                handler = new AutoTabOnMaxLengthHandler((TextBox)d);
                SetAutoTabOnMaxLengthHandler(d, handler);
            }
        }
コード例 #3
0
 public static void SetAutoTabOnMaxLengthHandler(DependencyObject d, AutoTabOnMaxLengthHandler value)
 {
     d.SetValue(AutoTabOnMaxLengthHandlerProperty, value);
 }
コード例 #4
0
 public static void SetAutoTabOnMaxLengthHandler(DependencyObject d, AutoTabOnMaxLengthHandler value)
 {
     d.SetValue(AutoTabOnMaxLengthHandlerProperty, value);
 }