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); }
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, HsvColor oldValue, HsvColor newValue) { base.OnColorChanged(colorPoint, oldValue, newValue); ColorPaletteStrategy?.OnColorChanged(colorPoint, oldValue, Items.OfType <ColorPoint>().ToList()); }
protected virtual void OnColorPaletteStrategyChanged(ColorPaletteStrategy oldValue, ColorPaletteStrategy newValue) { }