Пример #1
0
        protected override void OnColorPaletteStrategyChanged(ColorPaletteStrategy oldValue, ColorPaletteStrategy newValue)
        {
            base.OnColorPaletteStrategyChanged(oldValue, newValue);

            newValue?.ChangeColorPoints(Items.Cast <ColorPoint>().ToList());
            this.SelectedItem = Items.OfType <ColorPoint>().FirstOrDefault(c => c.IsPrimary);
        }
Пример #2
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);
            }
        }
Пример #3
0
        protected override void OnColorChanged(ColorPoint colorPoint, HsvColor oldValue, HsvColor newValue)
        {
            base.OnColorChanged(colorPoint, oldValue, newValue);

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