예제 #1
0
        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;
            }
        }
예제 #2
0
        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;
            }
        }