private static void OnIsSolidPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { BackgroundColorPicker source = d as BackgroundColorPicker; if (source.IsSolid) { source.BackgroundEnd = new SolidColorBrush() { Color = source.BackgroundStart.Color } } ; else { if (source.BackgroundStart.Color.ToString() != Colors.White.ToString()) { source.BackgroundEnd = new SolidColorBrush(Colors.White); } else { source.BackgroundEnd = new SolidColorBrush(Colors.LightGray); } } source.setupPalette(); }
private static void colorChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { BackgroundColorPicker source = d as BackgroundColorPicker; source.setupPalette(); if (source.ColorChanged != null) { source.ColorChanged(source, null); } }
public override void Execute(object parameter) { if (View.Instance == null) return; if (backgroundColorPicker != null) backgroundColorPicker.ColorChanged -= backgroundColorPicker_ColorChanged; //creating control again because this mimics the sharepoint experience backgroundColorPicker = new BackgroundColorPicker(); backgroundColorPicker.ThemeColors = View.Instance.ThemeColors; backgroundColorPicker.BackgroundStart = new SolidColorBrush(View.Instance.ApplicationColorSet.BackgroundStartGradientColor); backgroundColorPicker.BackgroundEnd = new SolidColorBrush(View.Instance.ApplicationColorSet.BackgroundEndGradientColor); backgroundColorPicker.ColorChanged += new EventHandler(backgroundColorPicker_ColorChanged); MapApplication.Current.ShowWindow(Resources.Strings.ChangeBackground, backgroundColorPicker); }
public override void Execute(object parameter) { if (View.Instance == null) { return; } if (backgroundColorPicker != null) { backgroundColorPicker.ColorChanged -= backgroundColorPicker_ColorChanged; } //creating control again because this mimics the sharepoint experience backgroundColorPicker = new BackgroundColorPicker(); backgroundColorPicker.ThemeColors = View.Instance.ThemeColors; backgroundColorPicker.BackgroundStart = new SolidColorBrush(View.Instance.ApplicationColorSet.BackgroundStartGradientColor); backgroundColorPicker.BackgroundEnd = new SolidColorBrush(View.Instance.ApplicationColorSet.BackgroundEndGradientColor); backgroundColorPicker.ColorChanged += new EventHandler(backgroundColorPicker_ColorChanged); MapApplication.Current.ShowWindow(Resources.Strings.ChangeBackground, backgroundColorPicker); }
private static void IsStartChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { BackgroundColorPicker source = d as BackgroundColorPicker; source.setupPalette(); }
private static void OnThemeColorsPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { BackgroundColorPicker source = d as BackgroundColorPicker; source.ApplyThemeColors(); }