public void Execute(object parameter) { UserTagView tag = Exceptions.CheckArgumentNull((UserTagView)parameter, "parameter"); FontChooser chooser = new FontChooser { FontDescriptor = (FontDescriptor)tag.Font }; if (chooser.ShowDialog() == true) { tag.Font = (FontDescriptorView)chooser.FontDescriptor; } }
private static void OnPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { UserTagView tag = (UserTagView)d; if (e.Property == ForegroundProperty) { tag.ForegroundBrush = new SolidColorBrush((Color)e.NewValue); } else if (e.Property == BackgroundProperty) { tag.BackgroundBrush = new SolidColorBrush((Color)e.NewValue); } else { throw new NotImplementedException(); } }
public void Execute(object parameter) { UserTagView tag = Exceptions.CheckArgumentNull((UserTagView)parameter, "parameter"); tag.Font = (FontDescriptorView)FontDescriptor.Default; }