private static void OnSpinningPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { BizzySpinner me = (BizzySpinner)d; if (me.IsSpinningChanged != null) { me.IsSpinningChanged(me, e); } }
private static void OnAnglePropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { BizzySpinner me = (BizzySpinner)d; if (!me.Spin && me.IsEnabled) { me.SpinAngle = (double)e.NewValue; } }
private static void OnSpinRatePropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { BizzySpinner me = (BizzySpinner)d; if (me.Spinning) { if (me.spinAnimation != null) { Duration duration = TimeSpan.FromSeconds((double)e.NewValue); if (me.spinAnimation.Duration != duration) { me.spinAnimation.Duration = duration; me.ReBeginSpinningAnimation(); } } } }
private static void OnSpinPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { BizzySpinner me = (BizzySpinner)d; if ((bool)e.NewValue) { // Spin is true: turn spin on if this control is enabled me.ControlSpinning(me.IsEnabled); } if (!(bool)e.NewValue) { me.ControlSpinning(false); } if (me.IsSpinChanged != null) { me.IsSpinChanged(me, e); } }