コード例 #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
        void UpdateFlyoutLayoutBehavior()
        {
            var behavior = (_flyoutLayoutBehavior == FlyoutLayoutBehavior.Default) ? s_defaultFlyoutLayoutBehavior : _flyoutLayoutBehavior;

            // Screen orientation affects those 2 behaviors
            if (behavior == FlyoutLayoutBehavior.SplitOnLandscape || behavior == FlyoutLayoutBehavior.SplitOnPortrait)
            {
                if ((_orientation == DeviceOrientation.Landscape && behavior == FlyoutLayoutBehavior.SplitOnLandscape) || (_orientation == DeviceOrientation.Portrait && behavior == FlyoutLayoutBehavior.SplitOnPortrait))
                {
                    behavior = FlyoutLayoutBehavior.Split;
                }
                else
                {
                    behavior = FlyoutLayoutBehavior.Popover;
                }
            }

            IsSplit = (behavior == FlyoutLayoutBehavior.Split);
            UpdateIsPresentChangeable?.Invoke(this, new UpdateIsPresentChangeableEventArgs(!IsSplit));
        }