public override Grid Load(dynamic f) { Grid g = base.Load((Fiction)f); Grid grg = FormCreator.CreateGrid(new Thickness(0, 0, 0, 0)); grg.Children.Add(FormCreator.CreateLabel("coWorkers", new Thickness(10, 9, 0, 0))); grg.Children.Add(FormCreator.CreateTextBox("InpFictFantCoWorkers", f.CoAuthors, new Thickness(10, 37, 0, 0))); grg.Children.Add(FormCreator.CreateLabel("Type", new Thickness(10, 59, 0, 0))); ComboBox cb = FormCreator.CreateComboBox("ChooseFictFantType", new Thickness(10, 87, 0, 0), new string[] { "FairyTales", "ScienceFiction" }); cb.SelectionChanged += new SelectionChangedEventHandler(SelectionChanged); grg.Children.Add(cb); GroupBox gr = FormCreator.CreateGroupBox("FictFantasticTalesGroup", "Fantastic Tales", new Thickness(329, 0, 0, 0), 171, 361); gr.Content = grg; g.Children.Add(gr); GroupBox fictionGroupBox = g.Children.OfType <GroupBox>().First(x => x.Name == "FictionGroup"); IEnumerable <ComboBox> cbList = ((Grid)fictionGroupBox.Content).Children.OfType <ComboBox>(); ComboBox genreComboBox = cbList.First(x => x.Name == "ChooseFictType"); genreComboBox.SelectedIndex = 0; return(g); }
public override Grid Load(dynamic h) { Grid g = base.Load((Book)h); Grid grg = FormCreator.CreateGrid(new Thickness(0, 0, 0, 0)); grg.Children.Add(FormCreator.CreateLabel("Period", new Thickness(10, 10, 0, 0))); grg.Children.Add(FormCreator.CreateTextBox("InpHistPeriod", h.Period, new Thickness(10, 38, 0, 0))); grg.Children.Add(FormCreator.CreateLabel("Type", new Thickness(10, 60, 0, 0))); ComboBox cb = FormCreator.CreateComboBox("ChooseHistType", new Thickness(10, 88, 0, 0), new string[] { "Art", "Biography" }); cb.SelectionChanged += new SelectionChangedEventHandler(SelectionChanged); grg.Children.Add(cb); GroupBox gr = FormCreator.CreateGroupBox("HistoricalGroup", "Historical", new Thickness(155, 0, 0, 0), 174, 361); gr.Content = grg; g.Children.Add(gr); IEnumerable <ComboBox> cbList = g.Children.OfType <ComboBox>(); ComboBox genreComboBox = cbList.First(x => x.Name == "ChooseGenre"); genreComboBox.SelectedIndex = 2; return(g); }
public override Grid Load(dynamic f) { Grid g = base.Load((Book)f); Grid grg = FormCreator.CreateGrid(new Thickness(0, 0, 0, 0)); grg.Children.Add(FormCreator.CreateLabel("Type (original, fanfiction)", new Thickness(10, 9, 0, 0))); grg.Children.Add(FormCreator.CreateTextBox("InpFictType", f.Type, new Thickness(10, 37, 0, 0))); grg.Children.Add(FormCreator.CreateLabel("Age limit", new Thickness(10, 59, 0, 0))); grg.Children.Add(FormCreator.CreateTextBox("InpFictAge", f.Age, new Thickness(10, 87, 0, 0))); grg.Children.Add(FormCreator.CreateLabel("Type", new Thickness(10, 109, 0, 0))); ComboBox cb = FormCreator.CreateComboBox("ChooseFictType", new Thickness(10, 138, 0, 0), new string[] { "FantasticTales", "Travelling" }); cb.SelectionChanged += new SelectionChangedEventHandler(SelectionChanged); grg.Children.Add(cb); GroupBox gr = FormCreator.CreateGroupBox("FictionGroup", "Fiction", new Thickness(155, 0, 0, 0), 174, 361); gr.Content = grg; g.Children.Add(gr); IEnumerable <ComboBox> cbList = g.Children.OfType <ComboBox>(); ComboBox genreComboBox = cbList.First(x => x.Name == "ChooseGenre"); genreComboBox.SelectedIndex = 1; return(g); }
public virtual Grid Load(dynamic b) { Grid g = new Grid(); g.Children.Add(FormCreator.CreateLabel("Author", new Thickness(10, 27, 0, 0))); g.Children.Add(FormCreator.CreateTextBox("InpAuthor", b.Author, new Thickness(10, 55, 0, 0))); g.Children.Add(FormCreator.CreateLabel("Name", new Thickness(10, 77, 0, 0))); g.Children.Add(FormCreator.CreateTextBox("InpName", b.Name, new Thickness(10, 105, 0, 0))); g.Children.Add(FormCreator.CreateLabel("Publishing office", new Thickness(10, 128, 0, 0))); g.Children.Add(FormCreator.CreateTextBox("InpPublishing", b.PublishingOffice, new Thickness(10, 156, 0, 0))); g.Children.Add(FormCreator.CreateLabel("Book genre", new Thickness(10, 183, 0, 0))); ComboBox cb = FormCreator.CreateComboBox("ChooseGenre", new Thickness(10, 211, 0, 0), new string[] { "Encyclopedia", "Fiction", "Historical" }); cb.SelectionChanged += new SelectionChangedEventHandler(SelectionChanged); g.Children.Add(cb); return(g); }