Font settings
Inheritance: INotifyPropertyChanged
Exemplo n.º 1
0
		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,
			};
		}
Exemplo n.º 3
0
		void UpdateActive() {
			var newActive = ThemeFontSettings.Active;
			if (activeFontSettings == newActive)
				return;
			if (activeFontSettings != null)
				activeFontSettings.PropertyChanged -= ActiveFontSettings_PropertyChanged;
			activeFontSettings = newActive;
			activeFontSettings.PropertyChanged += ActiveFontSettings_PropertyChanged;
		}
Exemplo n.º 4
0
		void Initialize(FontSettings fontSettings) {
			if (prevFontSettings == fontSettings)
				return;
			if (prevFontSettings != null)
				prevFontSettings.PropertyChanged -= FontSettings_PropertyChanged;
			prevFontSettings = fontSettings;
			fontSettings.PropertyChanged += FontSettings_PropertyChanged;
			UpdateFont(fontSettings);
		}
Exemplo n.º 5
0
		public FontSettingsCreatedEventArgs(FontSettings fontSettings) {
			if (fontSettings == null)
				throw new ArgumentNullException(nameof(fontSettings));
			FontSettings = fontSettings;
		}
Exemplo n.º 6
0
		internal void Initialize(Guid activeThemeGuid) => active = GetSettings(activeThemeGuid);
Exemplo n.º 7
0
		void UpdateFont(FontSettings fontSettings) =>
			Application.Current.Resources["TextEditorFontFamily"] = fontSettings.FontFamily;