상속: Windows.UI.Xaml.Controls.UserControl
예제 #1
0
 private void UpdateMarginToFitHamburgerMenu(HamburgerMenu hamburgerMenu = null)
 {
     hamburgerMenu = hamburgerMenu ?? ParentHamburgerMenu;
     if (hamburgerMenu == null)
     {
         Margin = new Thickness(0);
         return;
     }
     switch (hamburgerMenu.DisplayMode)
     {
         case SplitViewDisplayMode.Overlay:
             {
                 var buttonVisible = hamburgerMenu.HamburgerButtonVisibility == Visibility.Visible;
                 Margin = buttonVisible ? new Thickness(0) : new Thickness(48, 0, 0, 0);
             }
             break;
         case SplitViewDisplayMode.Inline:
         case SplitViewDisplayMode.CompactOverlay:
         case SplitViewDisplayMode.CompactInline:
             {
                 Margin = new Thickness(0);
             }
             break;
     }
 }
예제 #2
0
        private void RegisterHamburgerMenuChanges(HamburgerMenu hamburgerMenu)
        {
            hamburgerMenu = hamburgerMenu ?? ParentHamburgerMenu;
            if (hamburgerMenu == null)
            {
                return;
            }

            hamburgerMenu.UnregisterPropertyChangedCallback(HamburgerMenu.IsOpenProperty, callBackIsOpenId ?? 0);
            callBackIsOpenId = hamburgerMenu.RegisterPropertyChangedCallback(HamburgerMenu.IsOpenProperty, (obj, dp) => OnHamburgerMenuIsOpenPropertyChanged(obj as HamburgerMenu));

            hamburgerMenu.UnregisterPropertyChangedCallback(HamburgerMenu.DisplayModeProperty, callBackDisplayModeId ?? 0);
            callBackDisplayModeId = hamburgerMenu.RegisterPropertyChangedCallback(HamburgerMenu.DisplayModeProperty, (obj, dp) => OnHamburgerMenuDisplayModePropertyChanged(obj as HamburgerMenu));
        }
예제 #3
0
        private void RegisterHamburgerMenuChanges()
        {
            deRegHamburgerEvents = null; // default on PageHeader startup

            var hamburgerMenu = ParentHamburgerMenu;

            if (hamburgerMenu != null)
            {
                deRegHamburgerEvents              = hamburgerMenu; // remember to deregister on UnLoaded event
                hamburgerMenu.IsOpenChanged      += HamburgerMenu_IsOpenChanged;
                hamburgerMenu.DisplayModeChanged += HamburgerMenu_DisplayModeChanged;
                hamburgerMenu.HamburgerButtonVisibilityChanged += HamburgerMenu_HamburgerButtonVisibilityChanged;
            }
        }
예제 #4
0
 private void UpdateMargin(HamburgerMenu ham)
 {
     var value = (ham.IsOpen) ? ham.PaneWidth : 48d;
     BottomAppBar.Margin = new Thickness(value, 0, 0, 0);
 }
예제 #5
0
 private void OnHamburgerMenuIsOpenPropertyChanged(HamburgerMenu hamburgerMenu) => UpdateMarginToFitHamburgerMenu(hamburgerMenu);
예제 #6
0
 private void OnHamburgerMenuDisplayModePropertyChanged(HamburgerMenu hamburgerMenu) => UpdateMarginToFitHamburgerMenu(hamburgerMenu);