internal void SetActive(Guid themeGuid) { var settings = GetSettings(themeGuid); if (Active == settings) return; active = settings; OnPropertyChanged(nameof(Active)); }
public FontAndColorOptionsImpl(TextAppearanceCategory textAppearanceCategory) { this.textAppearanceCategory = textAppearanceCategory; fontSettings = textAppearanceCategory.ThemeFontSettings.Active; FontOption = new FontOption(fontSettings.FontType) { FontFamily = fontSettings.FontFamily, FontSize = fontSettings.FontSize, }; }
void UpdateActive() { var newActive = ThemeFontSettings.Active; if (activeFontSettings == newActive) return; if (activeFontSettings != null) activeFontSettings.PropertyChanged -= ActiveFontSettings_PropertyChanged; activeFontSettings = newActive; activeFontSettings.PropertyChanged += ActiveFontSettings_PropertyChanged; }
void Initialize(FontSettings fontSettings) { if (prevFontSettings == fontSettings) return; if (prevFontSettings != null) prevFontSettings.PropertyChanged -= FontSettings_PropertyChanged; prevFontSettings = fontSettings; fontSettings.PropertyChanged += FontSettings_PropertyChanged; UpdateFont(fontSettings); }
public FontSettingsCreatedEventArgs(FontSettings fontSettings) { if (fontSettings == null) throw new ArgumentNullException(nameof(fontSettings)); FontSettings = fontSettings; }
internal void Initialize(Guid activeThemeGuid) => active = GetSettings(activeThemeGuid);
void UpdateFont(FontSettings fontSettings) => Application.Current.Resources["TextEditorFontFamily"] = fontSettings.FontFamily;