Beispiel #1
0
        /// <summary>
        ///     Check for the conditions where the navigation pane does not occupy the space under the floating
        ///     hamburger button and trigger the event.
        /// </summary>
        private void CheckTogglePaneButtonSizeChanged()
        {
            if (RootSplitView.DisplayMode == SplitViewDisplayMode.Inline ||
                RootSplitView.DisplayMode == SplitViewDisplayMode.Overlay ||
                RootSplitView.DisplayMode == SplitViewDisplayMode.CompactOverlay)
            {
                var transform = TogglePaneButton.TransformToVisual(this);
                var rect      =
                    transform.TransformBounds(new Rect(0, 0, TogglePaneButton.ActualWidth, TogglePaneButton.ActualHeight));
                TogglePaneButtonRect = rect;
            }
            else
            {
                TogglePaneButtonRect = new Rect();
            }

            if (RootSplitView.DisplayMode == SplitViewDisplayMode.Overlay)
            {
                RootSplitView.IsPaneOpen = false;
            }

            var handler = TogglePaneButtonRectChanged;

            handler?.DynamicInvoke(this, TogglePaneButtonRect);
        }
Beispiel #2
0
 /// <summary>
 /// Check for the conditions where the navigation pane does not occupy the space under the floating
 /// hamburger button and trigger the event.
 /// </summary>
 private void CheckTogglePaneButtonSizeChanged()
 {
     TogglePaneButtonRect =
         RootSplitView.DisplayMode == SplitViewDisplayMode.Inline ||
         RootSplitView.DisplayMode == SplitViewDisplayMode.Overlay
             ? TogglePaneButton.TransformToVisual(this).TransformBounds(
             new Rect(0, 0, TogglePaneButton.ActualWidth, TogglePaneButton.ActualHeight))
             : new Rect();
     TogglePaneButtonRectChanged?.Invoke(this, this.TogglePaneButtonRect);
 }
Beispiel #3
0
        /// <summary>
        /// Check for the conditions where the navigation pane does not occupy the space under the floating
        /// hamburger button and trigger the event.
        /// </summary>
        private void CheckTogglePaneButtonSizeChanged()
        {
            if (RootSplitView.DisplayMode == SplitViewDisplayMode.Inline ||
                RootSplitView.DisplayMode == SplitViewDisplayMode.Overlay)
            {
                GeneralTransform transform = TogglePaneButton.TransformToVisual(this);
                Rect             rect      = transform.TransformBounds(new Rect(0, 0, TogglePaneButton.ActualWidth, TogglePaneButton.ActualHeight));
                TogglePaneButtonRect = rect;
            }
            else
            {
                TogglePaneButtonRect = new Rect();
            }

            TypedEventHandler <MainPage, Rect> handler = TogglePaneButtonRectChanged;

            // handler(this, this.TogglePaneButtonRect);
            handler?.DynamicInvoke(this, TogglePaneButtonRect);
        }
        /// <summary>
        /// Check for the conditions where the navigation pane does not occupy the space under the floating
        /// hamburger button and trigger the event.
        /// </summary>
        private void CheckTogglePaneButtonSizeChanged()
        {
            if (RootSplitView.DisplayMode == SplitViewDisplayMode.Inline ||
                RootSplitView.DisplayMode == SplitViewDisplayMode.Overlay)
            {
                var transform = TogglePaneButton.TransformToVisual(this);
                var rect      = transform.TransformBounds(new Rect(0, 0, TogglePaneButton.ActualWidth, TogglePaneButton.ActualHeight));
                TogglePaneButtonRect = rect;
            }
            else
            {
                TogglePaneButtonRect = new Rect();
            }

            var handler = TogglePaneButtonRectChanged;

            if (handler != null)
            {
                // handler(this, this.TogglePaneButtonRect);
                handler.DynamicInvoke(this, TogglePaneButtonRect);
            }
        }
Beispiel #5
0
        /// <summary>
        ///     Check for the conditions where the navigation pane does not occupy the space under the floating
        ///     hamburger button and trigger the event.
        /// </summary>
        private void CheckTogglePaneButtonSizeChanged()
        {
            if (RootSplitView.DisplayMode == SplitViewDisplayMode.Inline ||
                RootSplitView.DisplayMode == SplitViewDisplayMode.Overlay ||
                RootSplitView.DisplayMode == SplitViewDisplayMode.CompactOverlay)
            {
                var transform = TogglePaneButton.TransformToVisual(this);
                var rect      =
                    transform.TransformBounds(new Rect(0, 0, TogglePaneButton.ActualWidth, TogglePaneButton.ActualHeight));
                TogglePaneButtonRect = rect;
            }
            else
            {
                TogglePaneButtonRect = new Rect();
            }

            if (RootSplitView.DisplayMode == SplitViewDisplayMode.Overlay && !RootSplitView.IsPaneOpen &&
                !new SettingsManager(new WindowsUwpSettings()).IsDarkThemeSelected)
            {
                TogglePaneButton.Foreground =
                    (SolidColorBrush)Application.Current.Resources["SplitViewToggleButtonForegroundDark"];
            }
            else
            {
                TogglePaneButton.Foreground =
                    (SolidColorBrush)Application.Current.Resources["SplitViewToggleButtonForegroundLight"];
            }

            if (RootSplitView.DisplayMode == SplitViewDisplayMode.Overlay)
            {
                RootSplitView.IsPaneOpen = false;
            }

            var handler = TogglePaneButtonRectChanged;

            handler?.DynamicInvoke(this, TogglePaneButtonRect);
        }