示例#1
0
        private static void AllowArbitraryFontSizesPropertyCallback(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            ColorFontChooser chooser = d as ColorFontChooser;

            if (e.NewValue == null)
            {
                return;
            }

            chooser.tbFontSize.IsEnabled = (bool)e.NewValue;
        }
示例#2
0
        private static void ShowColorPickerPropertyCallback(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            ColorFontChooser chooser = d as ColorFontChooser;

            if (e.NewValue == null)
            {
                return;
            }
            if ((bool)e.NewValue == true)
            {
                chooser.groupBoxColorPicker.Visibility = Visibility.Visible;
            }
            else
            {
                chooser.groupBoxColorPicker.Visibility = Visibility.Collapsed;
            }
        }
示例#3
0
        private static void PreviewFontInFontListPropertyCallback(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            ColorFontChooser chooser = d as ColorFontChooser;

            if (e.NewValue == null)
            {
                return;
            }
            if ((bool)e.NewValue == true)
            {
                chooser.lstFamily.ItemTemplate = chooser.Resources["fontFamilyData"] as DataTemplate;
            }
            else
            {
                chooser.lstFamily.ItemTemplate = chooser.Resources["fontFamilyDataWithoutPreview"] as DataTemplate;
            }
        }