Browse Source

Added ValueChanged event to DateTimeUpDown and NumericUpDown.

pull/1645/head
brianlagunas_cp 15 years ago
parent
commit
37ca2046a3
  1. 15
      ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/Core/Primitives/InputBase.cs
  2. 2
      ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/DateTimeUpDown/DateTimeUpDown.cs
  3. 1
      ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/NumericUpDown/NumericUpDown.cs

15
ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/Core/Primitives/InputBase.cs

@ -80,7 +80,9 @@ namespace Microsoft.Windows.Controls.Primitives
protected virtual void OnValueChanged(object oldValue, object newValue)
{
RoutedPropertyChangedEventArgs<object> args = new RoutedPropertyChangedEventArgs<object>(oldValue, newValue);
args.RoutedEvent = InputBase.ValueChangedEvent;
RaiseEvent(args);
}
private static object OnCoerceValuePropertyCallback(DependencyObject d, object baseValue)
@ -139,6 +141,17 @@ namespace Microsoft.Windows.Controls.Primitives
#endregion //Base Class Overrides
#region Events
public static readonly RoutedEvent ValueChangedEvent = EventManager.RegisterRoutedEvent("ValueChanged", RoutingStrategy.Bubble, typeof(RoutedPropertyChangedEventHandler<object>), typeof(InputBase));
public event RoutedPropertyChangedEventHandler<object> ValueChanged
{
add { AddHandler(ValueChangedEvent, value); }
remove { RemoveHandler(ValueChangedEvent, value); }
}
#endregion //Events
#region Methods
protected void SyncTextAndValueProperties(DependencyProperty p, object newValue)

2
ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/DateTimeUpDown/DateTimeUpDown.cs

@ -62,6 +62,8 @@ namespace Microsoft.Windows.Controls
{
//whenever the value changes we need to parse out the value into out DateTimeInfo segments so we can keep track of the individual pieces
ParseValueIntoDateTimeInfo();
base.OnValueChanged(oldValue, newValue);
}
#endregion //Constructors

1
ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/NumericUpDown/NumericUpDown.cs

@ -99,6 +99,7 @@ namespace Microsoft.Windows.Controls
protected override void OnValueChanged(object oldValue, object newValue)
{
SetValidSpinDirection();
base.OnValueChanged(oldValue, newValue);
}
protected override object OnCoerceValue(object value)

Loading…
Cancel
Save