private static void OnTextPropertyChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e) { //To be called whenever the DP is changed. TwoIntegerNumericUpDown tinup = sender as TwoIntegerNumericUpDown; if (tinup != null && e.NewValue != null) { tinup.textBoxValue.Text = e.NewValue.ToString(); } }
private static void OnButtonsIntervalPropertyChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e) { //To be called whenever the DP is changed. TwoIntegerNumericUpDown tinup = sender as TwoIntegerNumericUpDown; if (tinup != null) { tinup.upButton.Interval = (int)e.NewValue; tinup.DownButton.Interval = (int)e.NewValue; } }