Beispiel #1
0
        private static void OnInternalColorChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            ColorPicker picker = (ColorPicker)d;

            Color oldValue = (Color)e.OldValue;
            Color newValue = (Color)e.NewValue;

            picker.SetValue(ColorProperty, newValue);
        }
Beispiel #2
0
        private static void OnColorChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            ColorPicker picker = (ColorPicker)d;

            Color oldValue = (Color)e.OldValue;
            Color newValue = (Color)e.NewValue;

            picker.SetValue(InternalColorProperty, newValue);

            picker.OnColorChanged(oldValue, newValue);

            ColorPickerAutomationPeer peer = UIElementAutomationPeer.FromElement(picker) as ColorPickerAutomationPeer;

            if (peer != null)
            {
                peer.RaiseValueChangedAutomationEvent(oldValue, newValue);
            }
        }