Пример #1
0
        private static void OnColorPaletteStrategyChanged(DependencyObject obj, DependencyPropertyChangedEventArgs args)
        {
            ColorPalette         target   = obj as ColorPalette;
            ColorPaletteStrategy oldValue = (ColorPaletteStrategy)args.OldValue;
            ColorPaletteStrategy newValue = (ColorPaletteStrategy)args.NewValue;

            if (oldValue != newValue)
            {
                target.OnColorPaletteStrategyChanged(oldValue, newValue);
            }
        }
        protected override void OnColorChanged(ColorPoint colorPoint, Color oldValue, Color newValue)
        {
            base.OnColorChanged(colorPoint, oldValue, newValue);

            ColorPaletteStrategy?.OnColorChanged(colorPoint, oldValue, Items.OfType <ColorPoint>().ToList());
        }
Пример #3
0
 protected virtual void OnColorPaletteStrategyChanged(ColorPaletteStrategy oldValue, ColorPaletteStrategy newValue)
 {
 }
        protected override void OnColorPaletteStrategyChanged(ColorPaletteStrategy oldValue, ColorPaletteStrategy newValue)
        {
            base.OnColorPaletteStrategyChanged(oldValue, newValue);

            newValue?.ChangeColorPoints(Items.Cast <ColorPoint>().ToList());
        }