コード例 #1
0
        /// <summary>
        /// Composes the structure of all the necessary widgets.
        /// </summary>
        void ConfigureLayout()
        {
            _drawer.SetContent(null, true);
            _drawer.Hide();

            _splitPane.SetPartContent("left", null, true);
            _splitPane.SetPartContent("right", null, true);
            _splitPane.Hide();

            UnPackAll();

            // the structure for split mode and for popover mode looks differently
            if (IsSplit)
            {
                _splitPane.SetPartContent("left", _masterCanvas, true);
                _splitPane.SetPartContent("right", _detailCanvas, true);
                _splitPane.Show();
                _mainWidget = _splitPane;
                PackEnd(_splitPane);

                IsPresented = true;
                UpdateIsPresentChangeable?.Invoke(this, new UpdateIsPresentChangeableEventArgs(false));
                UpdateFocusPolicy(true);
            }
            else
            {
                _drawer.SetContent(_masterCanvas, true);
                _drawer.Show();
                _mainWidget = _detailCanvas;
                PackEnd(_detailCanvas);
                PackEnd(_drawer);

                _drawer.IsOpen = IsPresented;
                UpdateIsPresentChangeable?.Invoke(this, new UpdateIsPresentChangeableEventArgs(true));
                UpdateFocusPolicy();
            }

            _masterCanvas.Show();
            _detailCanvas.Show();

            // even though child was changed, Layout callback was not called, so i manually call layout function.
            // Layout callback was filter out when geometry was not changed in Native.Box
            UpdateChildCanvasGeometry();
        }
コード例 #2
0
        /// <summary>
        /// Composes the structure of all the necessary widgets.
        /// </summary>
        void ConfigureLayout()
        {
            _drawer.SetContent(null, true);
            _drawer.Hide();

            _splitPane.SetPartContent("left", null, true);
            _splitPane.SetPartContent("right", null, true);
            _splitPane.Hide();

            UnPackAll();

            // the structure for split mode and for popover mode looks differently
            if (_internalMasterBehavior == MasterBehavior.Split)
            {
                _splitPane.SetPartContent("left", _masterCanvas, true);
                _splitPane.SetPartContent("right", _detailCanvas, true);
                _splitPane.Show();
                _mainWidget = _splitPane;
                PackEnd(_splitPane);

                IsPresented = true;
                UpdateIsPresentChangeable?.Invoke(this, new UpdateIsPresentChangeableEventArgs {
                    CanChange = false
                });
            }
            else
            {
                _drawer.SetContent(_masterCanvas, true);
                _drawer.Show();
                _mainWidget = _detailCanvas;
                PackEnd(_detailCanvas);
                PackEnd(_drawer);

                _drawer.IsOpen = IsPresented;
                UpdateIsPresentChangeable?.Invoke(this, new UpdateIsPresentChangeableEventArgs {
                    CanChange = false
                });
            }

            _masterCanvas.Show();
            _detailCanvas.Show();
        }
コード例 #3
0
ファイル: ThemeManager.cs プロジェクト: zhamppx97/maui
 public static bool SetRightPart(this Panes panes, EvasObject content, bool preserveOldContent = false)
 {
     return(panes.SetPartContent(ThemeConstants.Panes.Parts.Right, content, preserveOldContent));
 }
コード例 #4
0
ファイル: PanesTest1.cs プロジェクト: yunmiha/TizenFX
        public override void Run(Window window)
        {
            Conformant conformant = new Conformant(window);

            conformant.Show();
            Box box = new Box(window);

            conformant.SetContent(box);
            box.Show();

            Rectangle redBox = new Rectangle(window)
            {
                AlignmentX = -1,
                AlignmentY = -1,
                WeightX    = 1,
                WeightY    = 1,
                Color      = Color.Red,
            };

            redBox.Show();
            Rectangle blueBox = new Rectangle(window)
            {
                AlignmentX = -1,
                AlignmentY = -1,
                WeightX    = 1,
                WeightY    = 1,
                Color      = Color.Blue,
            };
            Rectangle greenBox = new Rectangle(window)
            {
                AlignmentX = -1,
                AlignmentY = -1,
                WeightX    = 1,
                WeightY    = 1,
                Color      = Color.Green,
            };
            Panes subPanes = new Panes(window)
            {
                AlignmentX   = -1,
                AlignmentY   = -1,
                WeightX      = 1,
                WeightY      = 1,
                Proportion   = 0.3,
                IsHorizontal = false
            };

            subPanes.Show();
            subPanes.SetPartContent("left", blueBox);
            subPanes.SetPartContent("right", greenBox);
            Panes panes = new Panes(window)
            {
                AlignmentX   = -1,
                AlignmentY   = -1,
                WeightX      = 1,
                WeightY      = 1,
                Proportion   = 0.1,
                IsFixed      = true,
                IsHorizontal = true,
            };

            panes.SetPartContent("left", redBox);
            panes.SetPartContent("right", subPanes);
            panes.Show();
            box.PackEnd(panes);
        }