-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathChangeFont.xaml.cs
38 lines (35 loc) · 1.39 KB
/
ChangeFont.xaml.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
using MahApps.Metro.Controls;
using System.ComponentModel;
using System.Runtime.CompilerServices;
using System.Windows.Media;
namespace Notepad
{
public partial class ChangeFont : MetroWindow, INotifyPropertyChanged
{
public object valueChangeFont;
private string textFontWin;
public string TextFontWin
{
get { return textFontWin; }
set { textFontWin = value; OnPropertyChange(); }
}
public ChangeFont()
{
InitializeComponent();
fontComboFast.ItemsSource = Fonts.SystemFontFamilies;
TextFontWin = "Change Your Font using the Combo Box below.";
//((MainWindow)System.Windows.Application.Current.MainWindow).richtextbox.FontFamily = (FontFamily)"Consolas";
DataContext = this;
}
public event PropertyChangedEventHandler PropertyChanged;
private void OnPropertyChange([CallerMemberName] string caller = "")
{
if (PropertyChanged != null) { PropertyChanged(this, new PropertyChangedEventArgs(caller)); }
}
private void changeFont_Click(object sender, System.Windows.RoutedEventArgs e)
{
((MainWindow)System.Windows.Application.Current.MainWindow).richtextbox.FontFamily = (FontFamily)fontComboFast.SelectedItem;
Close();
}
}
}