private static void IsActivePropertyChanced(DependencyObject d, DependencyPropertyChangedEventArgs e) { LEDControl led = (LEDControl)d; if ((bool)e.NewValue) { led.backgroundColor.Color = led.ColorOn; } else { led.backgroundColor.Color = led.ColorOff; } }
private static void OnColorOffPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { LEDControl led = (LEDControl)d; led.ColorOff = (Color)e.NewValue; if (led.IsActive) { led.backgroundColor.Color = led.ColorOn; } else { led.backgroundColor.Color = led.ColorOff; } }