Beispiel #1
0
        internal void RefreshFlyoutPosition()
        {
            _paneRoot ??= _splitView.GetDescendantByName <FrameworkElement>("PaneRoot");
            if (_paneRoot == null)
            {
                return;
            }

            _HCPaneBorder ??= _splitView.GetDescendantByName <WRectangle>("HCPaneBorder");

            if (_paneRoot != null)
            {
                if (_height == -1)
                {
                    _paneRoot.Height            = double.NaN;
                    _paneRoot.VerticalAlignment = Microsoft.UI.Xaml.VerticalAlignment.Stretch;

                    if (_HCPaneBorder != null)
                    {
                        _HCPaneBorder.Visibility = Microsoft.UI.Xaml.Visibility.Visible;
                    }
                }
                else
                {
                    _paneRoot.Height            = _height;
                    _paneRoot.VerticalAlignment = Microsoft.UI.Xaml.VerticalAlignment.Top;

                    if (_HCPaneBorder != null)
                    {
                        _HCPaneBorder.Visibility = Microsoft.UI.Xaml.Visibility.Collapsed;
                    }
                }
            }
        }