示例#1
0
        /// <summary>
        /// Adds controls comprising the current view to the container of the view.
        /// The view will be visible immediately.
        /// </summary>
        internal override void Reveal()
        {
            _tagEditorPanel = new StackPanel {
                Orientation = Orientation.Horizontal
            };
            ViewContainer.Children.Add(_tagEditorPanel);

            _tagEditorPanel.Children.Add(new Label {
                Content = "Define new tag:"
            });
            _comboBox = new ComboBox
            {
                ItemsSource         = Configuration.GetAllTags(),
                IsEditable          = true,
                IsTextSearchEnabled = true,
                MinWidth            = 120
            };
            _comboBox.KeyUp += ComboBoxKeyUp;
            _tagEditorPanel.Children.Add(_comboBox);

            _saveButton        = UITheme.CreateButton("Save");
            _saveButton.Click += SaveButtonClick;
            _tagEditorPanel.Children.Add(_saveButton);

            if (AddApplyToSelectionButton)
            {
                _applyToSelectionButton        = UITheme.CreateButton("Apply to selection");
                _applyToSelectionButton.Click += ApplyButtonClick;
                _tagEditorPanel.Children.Add(_applyToSelectionButton);
            }
        }
        /// <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
        }
示例#3
0
        /// <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
        }
        internal override void Reveal()
        {
            base.Reveal();
            ViewContainer.RowDefinitions.Add(new RowDefinition {
                Height = new GridLength(1, GridUnitType.Star)
            });                                                                                                    //Base checks view occupies this
            ViewContainer.RowDefinitions.Add(new RowDefinition {
                Height = new GridLength(0, GridUnitType.Auto)
            });
            var checkFilterPanel = ViewContainer.Children.AddAndReference(new StackPanel {
                Orientation = Orientation.Horizontal
            });

            Grid.SetRow(checkFilterPanel, 1);
            checkFilterPanel.Children.Add(new Label {
                Content = "Filter:"
            });
            _checkFilterTextBox = checkFilterPanel.Children.AddAndReference(new TextBox {
                MinWidth = 120
            });
            _checkFilterTextBox.TextChanged += ReactionToCheckFilterChange;
            checkFilterPanel.Children.AddAndReference(UITheme.CreateButton("Clear filter")).Click += delegate { _checkFilterTextBox.Clear(); };
        }