Пример #1
0
        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;
            }
        }
Пример #2
0
        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();
            }
        }
Пример #3
0
        public void Execute(object parameter)
        {
            UserTagView tag = Exceptions.CheckArgumentNull((UserTagView)parameter, "parameter");

            tag.Font = (FontDescriptorView)FontDescriptor.Default;
        }