private void Initialize() { FontManager.GetLadder().Name = Properties.Resources.Element; FontManager.GetTitle().Name = Properties.Resources.Ladder_Title; FontManager.GetComment().Name = Properties.Resources.Comment; FontManager.GetFunc().Name = Properties.Resources.FuncBlock; DemoFontManager.GetLadder().Setup(FontManager.GetLadder()); DemoFontManager.GetTitle().Setup(FontManager.GetTitle()); DemoFontManager.GetComment().Setup(FontManager.GetComment()); DemoFontManager.GetFunc().Setup(FontManager.GetFunc()); CB_Range.Items.Add(new FontDataItem(DemoFontManager.GetLadder())); CB_Range.Items.Add(new FontDataItem(DemoFontManager.GetTitle())); CB_Range.Items.Add(new FontDataItem(DemoFontManager.GetComment())); CB_Range.Items.Add(new FontDataItem(DemoFontManager.GetFunc())); foreach (var fontFamily in (new InstalledFontCollection()).Families) { FontFamilyItem ffitem = new FontFamilyItem(fontFamily); CB_Family.Items.Add(ffitem); } for (int i = 22; i <= 60; i++) { ComboBoxItem item = new ComboBoxItem(); item.Content = i; CB_Size.Items.Add(item); } CB_Range.SelectedIndex = 0; }
private void OnEnsureButtonClick(object sender, RoutedEventArgs e) { FontManager.GetTitle().Setup( DemoFontManager.GetTitle()); FontManager.GetComment().Setup( DemoFontManager.GetComment()); FontManager.GetLadder().Setup( DemoFontManager.GetLadder()); FontManager.GetFunc().Setup( DemoFontManager.GetFunc()); EnsureButtonClick.Invoke(this, new RoutedEventArgs(ButtonBase.ClickEvent)); Close(); }