private static OnValueChanged ( DependencyObject d, DependencyPropertyChangedEventArgs e ) : void | ||
d | DependencyObject | |
e | DependencyPropertyChangedEventArgs | |
Résultat | void |
static NumericUpDown() { Class6.yDnXvgqzyB5jw(); NumericUpDown.ValueIncrementedEvent = EventManager.RegisterRoutedEvent("ValueIncremented", RoutingStrategy.Bubble, typeof(NumericUpDownChangedRoutedEventHandler), typeof(NumericUpDown)); NumericUpDown.ValueDecrementedEvent = EventManager.RegisterRoutedEvent("ValueDecremented", RoutingStrategy.Bubble, typeof(NumericUpDownChangedRoutedEventHandler), typeof(NumericUpDown)); NumericUpDown.DelayChangedEvent = EventManager.RegisterRoutedEvent("DelayChanged", RoutingStrategy.Bubble, typeof(RoutedEventHandler), typeof(NumericUpDown)); NumericUpDown.MaximumReachedEvent = EventManager.RegisterRoutedEvent("MaximumReached", RoutingStrategy.Bubble, typeof(RoutedEventHandler), typeof(NumericUpDown)); NumericUpDown.MinimumReachedEvent = EventManager.RegisterRoutedEvent("MinimumReached", RoutingStrategy.Bubble, typeof(RoutedEventHandler), typeof(NumericUpDown)); NumericUpDown.ValueChangedEvent = EventManager.RegisterRoutedEvent("ValueChanged", RoutingStrategy.Bubble, typeof(RoutedPropertyChangedEventHandler <double?>), typeof(NumericUpDown)); NumericUpDown.DelayProperty = DependencyProperty.Register("Delay", typeof(int), typeof(NumericUpDown), new FrameworkPropertyMetadata((object)500, new PropertyChangedCallback(NumericUpDown.OnDelayChanged)), new ValidateValueCallback(NumericUpDown.ValidateDelay)); NumericUpDown.TextAlignmentProperty = TextBox.TextAlignmentProperty.AddOwner(typeof(NumericUpDown)); NumericUpDown.SpeedupProperty = DependencyProperty.Register("Speedup", typeof(bool), typeof(NumericUpDown), new FrameworkPropertyMetadata(true, new PropertyChangedCallback(NumericUpDown.OnSpeedupChanged))); NumericUpDown.IsReadOnlyProperty = TextBoxBase.IsReadOnlyProperty.AddOwner(typeof(NumericUpDown), new FrameworkPropertyMetadata(false, FrameworkPropertyMetadataOptions.Inherits, new PropertyChangedCallback(NumericUpDown.IsReadOnlyPropertyChangedCallback))); NumericUpDown.StringFormatProperty = DependencyProperty.Register("StringFormat", typeof(string), typeof(NumericUpDown), new FrameworkPropertyMetadata(string.Empty, new PropertyChangedCallback(NumericUpDown.OnStringFormatChanged), new CoerceValueCallback(NumericUpDown.CoerceStringFormat))); NumericUpDown.InterceptArrowKeysProperty = DependencyProperty.Register("InterceptArrowKeys", typeof(bool), typeof(NumericUpDown), new FrameworkPropertyMetadata(true)); NumericUpDown.ValueProperty = DependencyProperty.Register("Value", typeof(double?), typeof(NumericUpDown), new FrameworkPropertyMetadata(null, FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, new PropertyChangedCallback(NumericUpDown.OnValueChanged), new CoerceValueCallback(NumericUpDown.CoerceValue))); NumericUpDown.ButtonsAlignmentProperty = DependencyProperty.Register("ButtonsAlignment", typeof(MahApps.Metro.Controls.ButtonsAlignment), typeof(NumericUpDown), new FrameworkPropertyMetadata((object)MahApps.Metro.Controls.ButtonsAlignment.Right, FrameworkPropertyMetadataOptions.AffectsMeasure | FrameworkPropertyMetadataOptions.AffectsArrange)); NumericUpDown.MinimumProperty = DependencyProperty.Register("Minimum", typeof(double), typeof(NumericUpDown), new FrameworkPropertyMetadata((object)double.MinValue, new PropertyChangedCallback(NumericUpDown.OnMinimumChanged))); NumericUpDown.MaximumProperty = DependencyProperty.Register("Maximum", typeof(double), typeof(NumericUpDown), new FrameworkPropertyMetadata((object)double.MaxValue, new PropertyChangedCallback(NumericUpDown.OnMaximumChanged), new CoerceValueCallback(NumericUpDown.CoerceMaximum))); NumericUpDown.IntervalProperty = DependencyProperty.Register("Interval", typeof(double), typeof(NumericUpDown), new FrameworkPropertyMetadata((object)1, new PropertyChangedCallback(NumericUpDown.IntervalChanged))); NumericUpDown.InterceptMouseWheelProperty = DependencyProperty.Register("InterceptMouseWheel", typeof(bool), typeof(NumericUpDown), new FrameworkPropertyMetadata(true)); NumericUpDown.TrackMouseWheelWhenMouseOverProperty = DependencyProperty.Register("TrackMouseWheelWhenMouseOver", typeof(bool), typeof(NumericUpDown), new FrameworkPropertyMetadata(false)); NumericUpDown.HideUpDownButtonsProperty = DependencyProperty.Register("HideUpDownButtons", typeof(bool), typeof(NumericUpDown), new PropertyMetadata(false)); NumericUpDown.UpDownButtonsWidthProperty = DependencyProperty.Register("UpDownButtonsWidth", typeof(double), typeof(NumericUpDown), new PropertyMetadata((object)20)); NumericUpDown.InterceptManualEnterProperty = DependencyProperty.Register("InterceptManualEnter", typeof(bool), typeof(NumericUpDown), new PropertyMetadata(true, new PropertyChangedCallback(NumericUpDown.InterceptManualEnterChangedCallback))); NumericUpDown.CultureProperty = DependencyProperty.Register("Culture", typeof(CultureInfo), typeof(NumericUpDown), new PropertyMetadata(null, (DependencyObject o, DependencyPropertyChangedEventArgs e) => { if (e.NewValue != e.OldValue) { NumericUpDown numericUpDown = (NumericUpDown)o; numericUpDown.OnValueChanged(numericUpDown.Value, numericUpDown.Value); } })); NumericUpDown.SelectAllOnFocusProperty = DependencyProperty.Register("SelectAllOnFocus", typeof(bool), typeof(NumericUpDown), new PropertyMetadata(true)); NumericUpDown.HasDecimalsProperty = DependencyProperty.Register("HasDecimals", typeof(bool), typeof(NumericUpDown), new FrameworkPropertyMetadata(true, new PropertyChangedCallback(NumericUpDown.OnHasDecimalsChanged))); NumericUpDown.RegexStringFormatHexadecimal = new Regex("^(?<complexHEX>.*{\\d:X\\d+}.*)?(?<simpleHEX>X\\d+)?$", RegexOptions.Compiled); FrameworkElement.DefaultStyleKeyProperty.OverrideMetadata(typeof(NumericUpDown), new FrameworkPropertyMetadata(typeof(NumericUpDown))); Control.VerticalContentAlignmentProperty.OverrideMetadata(typeof(NumericUpDown), new FrameworkPropertyMetadata((object)System.Windows.VerticalAlignment.Center)); Control.HorizontalContentAlignmentProperty.OverrideMetadata(typeof(NumericUpDown), new FrameworkPropertyMetadata((object)System.Windows.HorizontalAlignment.Right)); EventManager.RegisterClassHandler(typeof(NumericUpDown), UIElement.GotFocusEvent, new RoutedEventHandler(NumericUpDown.OnGotFocus)); }
private static void OnValueChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { NumericUpDown numericUpDown = (NumericUpDown)d; numericUpDown.OnValueChanged((double?)e.OldValue, (double?)e.NewValue); }