public static void ApplyFont(Control control, FontInfo font) { control.FontFamily = font.Family; control.FontSize = font.Size; control.FontStyle = font.Style; control.FontStretch = font.Stretch; control.FontWeight = font.Weight; control.Foreground = font.BrushColor; }
private void btnOk_Click(object sender, RoutedEventArgs e) { this.Font = this.colorFontChooser.SelectedFont; base.DialogResult = new bool?(true); }
public static FontInfo GetControlFont(Control control) { FontInfo font = new FontInfo() { Family = control.FontFamily, Size = control.FontSize, Style = control.FontStyle, Stretch = control.FontStretch, Weight = control.FontWeight, BrushColor = (SolidColorBrush)control.Foreground }; return font; }