Exemplo n.º 1
0
        /// <summary>
        /// Property changed callback for LEDs
        /// </summary>
        /// <param name="d">The DependencyObject</param>
        /// <param name="e">The DependencyPropertyChangedEventArgs</param>
        private static void LedsChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            LedControl c = d as LedControl;

            c.Leds = (List <Color>)e.NewValue;
            c.LoadLeds(d, null);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Property changed callback for the active LED index
        /// </summary>
        /// <param name="d">The DependencyObject</param>
        /// <param name="e">The DependencyPropertyChangedEventArgs</param>
        private static void ActiveLedChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            LedControl c = d as LedControl;

            c.ActiveLed = (int)e.NewValue;
            c.LedOff();
            c.LedOn();
        }