/// <summary> /// Adds controls comprising the current view to the container of the view. /// The view will be visible immediately. /// </summary> internal override void Reveal() { #region Define as many rows as there are logical row items in your view ViewContainer.RowDefinitions.Add(new RowDefinition { Height = new GridLength(1, GridUnitType.Star) }); ViewContainer.RowDefinitions.Add(new RowDefinition { Height = new GridLength(0, GridUnitType.Auto) }); ViewContainer.ColumnDefinitions.Add(new ColumnDefinition { Width = new GridLength(1, GridUnitType.Auto) }); //Checks ViewContainer.ColumnDefinitions.Add(new ColumnDefinition { Width = new GridLength(2, GridUnitType.Star) }); //Enlistment #endregion var checkViewContainer = ViewContainer.AddGridItem(0, UITheme.CreateGrid()); Grid.SetColumn(checkViewContainer, 0); checkViewContainer.RowDefinitions.Add(new RowDefinition { Height = new GridLength(1, GridUnitType.Star) }); //Checks view (tree and buttons) checkViewContainer.RowDefinitions.Add(new RowDefinition { Height = new GridLength(0, GridUnitType.Auto) }); //Check filter section _checksViewHandler = ViewFactory.CreateView(ViewType.ViewOnChecksWithFilter, checkViewContainer, Configuration) as ViewOnChecksWithFilterHandler; _checksViewHandler.ShowTagEditorView = false; _checksViewHandler.Reveal(); var rowOfButtonsToSelectOrUnselectAllChecks = checkViewContainer.Children.AddAndReference(new StackPanel { Orientation = Orientation.Horizontal }); Grid.SetRow(rowOfButtonsToSelectOrUnselectAllChecks, 1); Grid.SetColumn(rowOfButtonsToSelectOrUnselectAllChecks, 0); var selectAllFilteredChecks = rowOfButtonsToSelectOrUnselectAllChecks.Children.AddAndReference(UITheme.CreateButton("Select all")); selectAllFilteredChecks.Click += ReactionToClickingOnSelectAllFilteredChecks; var unselectAllFilteredChecks = rowOfButtonsToSelectOrUnselectAllChecks.Children.AddAndReference(UITheme.CreateButton("Clear selection")); unselectAllFilteredChecks.Click += ReactionToClickingOnUnselectFilteredChecks; #region Right side with the view on enlistment. var containerOfEnlistmentView = ViewContainer.AddGridItem(0, UITheme.CreateGrid()); Grid.SetColumn(containerOfEnlistmentView, 1); _enlistmentViewHandler = ViewFactory.CreateView(ViewType.ViewOnEnlistment, containerOfEnlistmentView, Configuration) as ViewOnEnlistmentHandler; _enlistmentViewHandler.ShowTagEditorView = false; _enlistmentViewHandler.Reveal(); #endregion #region Final 'Apply' button. It has to be in a panel or else it will stretch across the entire grid's column. var panelForApplyButton = ViewContainer.AddGridItem(1, new StackPanel { Orientation = Orientation.Horizontal }); var applyButton = panelForApplyButton.Children.AddAndReference(UITheme.CreateButton("Apply to enlistment selection")); applyButton.Click += ReactionToApplyButtonClick; #endregion }
/// <summary> /// Adds controls comprising the current view to the container of the view. /// The view will be visible immediately. /// </summary> internal override void Reveal() { ViewContainer.RowDefinitions.Add(new RowDefinition { Height = new GridLength(1, GridUnitType.Star) }); _treeView = ViewContainer.AddGridItem(0, new TreeView()); FillTreeWithEnlistmentData(); }
/// <summary> /// Adds controls comprising the current view to the container of the view. /// The view will be visible immediately. /// </summary> internal override void Reveal() { LeftSideView = ViewContainer.AddGridItem(0, 0, UITheme.CreateGrid()); LeftSideView.RowDefinitions.Add(new RowDefinition { Height = new GridLength(0, GridUnitType.Auto) }); //Language groups label LeftSideView.RowDefinitions.Add(new RowDefinition { Height = new GridLength(1, GridUnitType.Star) }); //Language groups control LeftSideView.RowDefinitions.Add(new RowDefinition { Height = new GridLength(0, GridUnitType.Auto) }); //Language groups label LeftSideView.AddGridItem(0, new Label { Content = "Select a language group to configure" }); LanguageGroupListView = LeftSideView.AddGridItem(1, new ListView()); LanguageGroupListView.SelectionChanged += LanguageGroupListSelectionChanged; TAGVIEWCONTAINER = LeftSideView.AddGridItem(2, 0, UITheme.CreateGrid()); TAGEDITORVIEW = (TagEditorViewHandler)ViewFactory.CreateView(ViewType.TagEditorView, TAGVIEWCONTAINER, Configuration); TAGEDITORVIEW.Reveal(); TAGEDITORVIEW.SaveTagEvent += savedTag => UpdateViewToMatchData(); RightSideView = ViewContainer.AddGridItem(0, 1, UITheme.CreateGrid()); IsRightSideEnabled = false; RightSideView.RowDefinitions.Add(new RowDefinition { Height = new GridLength(0, GridUnitType.Auto) }); //Languages label RightSideView.RowDefinitions.Add(new RowDefinition { Height = new GridLength(2, GridUnitType.Star) }); //Languages control AddLanguagesHeader(RightSideView, 0); LanguagesList = RightSideView.AddGridItem(1, new ListView()); AddContent(LanguagesList, Configuration.GetAllLanguages(), ContextType.Language); FillWithConfigurationData(); }