public MainWindow() { isblack = false; RichTextBox rch = (RichTextBox)this.FindName("mainbox"); siz = (ComboBox)this.FindName("Sizes"); FontSizes = new List <int>(); Colors = new List <string>() { "Red", "Green", "Blue" }; for (int i = 1; i < 50; i++) { FontSizes.Add(i); } OpenCommand = new GeneralCommand(Open, null); CutCommand = new GeneralCommand(Cut, null); CopyCommand = new GeneralCommand(Copy, null); PasteCommand = new GeneralCommand(Paste, null); SaveCommand = new GeneralCommand(Save, null); NewCommand = new GeneralCommand(New, null); CloseCommand = new GeneralCommand(CloseW, null); ChangeLangCommand = new GeneralCommand(ChangeLang, null); ChangeStyleCommand = new GeneralCommand(ChangeStyle, null); UndoCommand = new GeneralCommand(U, null); RedoCommand = new GeneralCommand(R, null); DataContext = this; System.Threading.Thread.CurrentThread.CurrentUICulture = System.Globalization.CultureInfo.GetCultureInfo("ru-RU"); InitializeComponent(); string[] linesformenu = System.IO.File.ReadAllLines(@"lastopened.txt"); foreach (var s in linesformenu) { MenuItem mi = new MenuItem(); mi.Header = s; mi.Click += mi_Click; MainMenu.Items.Add(mi); } this.Title = "NewWindow" + ++WindowsCount; StreamResourceInfo sriCurs = Application.GetResourceStream(new Uri("cur.cur", UriKind.Relative)); this.Cursor = new Cursor(sriCurs.Stream); }
public Logic() { RichBoxText = "asd"; FontSizes = new List <int>(); Colors = new List <string>() { "Red", "Green", "Blue" }; for (int i = 0; i < 50; i++) { FontSizes.Add(i); } OpenCommand = new GeneralCommand(Open, null); CutCommand = new GeneralCommand(Cut, null); }