Exemplo n.º 1
0
        private static void OnAlphaChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            ColorChooser c = d as ColorChooser;

            if (c != null)
            {
                c.UpdateAlpha();
            }
        }
Exemplo n.º 2
0
        private static void OnColorChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            ColorChooser c = d as ColorChooser;

            if (c != null)
            {
                c.SetColor((Color)e.NewValue);

                RoutedPropertyChangedEventArgs <Color> ea = new RoutedPropertyChangedEventArgs <Color>(
                    (Color)e.OldValue, (Color)e.NewValue, ColorChangedEvent);
                c.OnColorChanged(ea);
            }
        }
Exemplo n.º 3
0
        private static void OnValueChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            ColorChooser c = d as ColorChooser;

            if (d != null)
            {
                c.IsNull = e.NewValue is Color ? false : true;
                c.Color  = c.IsNull ? Colors.Transparent : (Color)e.NewValue;
            }

            RoutedPropertyChangedEventArgs <object> ea = new RoutedPropertyChangedEventArgs <object>(
                e.OldValue, e.NewValue, ValueChangedEvent);

            c.OnValueChanged(ea);
        }