/// <summary> /// Adds controls comprising the current view to the container of the view. /// The view will be visible immediately. /// </summary> internal override void Reveal() { _gridContainer = ViewContainer.Children.AddAndReference(UITheme.CreateGrid()); Grid.SetRow(_gridContainer, 0); //In case we are contained in a grid which has more rows and columns Grid.SetColumn(_gridContainer, 0); #region Define as many rows as there are logical row items in your view _gridContainer.RowDefinitions.Add(new RowDefinition { Height = new GridLength(1, GridUnitType.Star) }); _gridContainer.RowDefinitions.Add(new RowDefinition { Height = new GridLength(0, GridUnitType.Auto) }); #endregion _treeView = _gridContainer.AddGridItem(0, new TreeView()); FillTreeWithEnlistmentData(); #region Tag editor view if (ShowTagEditorView) { var tagEditorViewContainer = _gridContainer.AddGridItem(1, UITheme.CreateGrid()); _tagEditorViewHandler = ViewFactory.CreateView(ViewType.TagEditorView, tagEditorViewContainer, Configuration) as TagEditorViewHandler; _tagEditorViewHandler.ApplyTagToSelectionEvent += ApplyTagToSelection; _tagEditorViewHandler.Reveal(); } #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() { _gridContainer = ViewContainer.Children.AddAndReference(UITheme.CreateGrid()); #region Define as many rows as there are logical row items in your view _gridContainer.RowDefinitions.Add(new RowDefinition { Height = new GridLength(1, GridUnitType.Star) }); _gridContainer.RowDefinitions.Add(new RowDefinition { Height = new GridLength(0, GridUnitType.Auto) }); _gridContainer.RowDefinitions.Add(new RowDefinition { Height = new GridLength(0, GridUnitType.Auto) }); _gridContainer.RowDefinitions.Add(new RowDefinition { Height = new GridLength(0, GridUnitType.Auto) }); #endregion _treeView = _gridContainer.AddGridItem(0, new TreeView()); FillTreeWithEnlistmentData(); #region Tag editor view var tagEditorViewContainer = _gridContainer.AddGridItem(2, UITheme.CreateGrid()); _tagEditorViewHandler = new TagEditorViewHandler(tagEditorViewContainer, Configuration); _tagEditorViewHandler.ApplyTagToSelectionEvent += ApplyTagToSelection; _tagEditorViewHandler.Reveal(); #endregion #region Filter var projectFilterPanel = _gridContainer.AddGridItem(3, new StackPanel { Orientation = Orientation.Horizontal }); projectFilterPanel.Children.Add(new Label { Content = "Filter:" }); _FilterTextBox = projectFilterPanel.Children.AddAndReference(new TextBox { MinWidth = 120, MaxWidth = 120 }); _FilterTextBox.TextChanged += delegate { UpdateViewToMatchData(); }; projectFilterPanel.Children.AddAndReference(UITheme.CreateButton("Clear filter")).Click += delegate { _FilterTextBox.Clear(); }; #endregion }