public static void MapFlyoutBehavior(FlyoutViewHandler handler, IFlyoutView flyoutView)
        {
            var nativeView = handler.NativeView;

            switch (flyoutView.FlyoutBehavior)
            {
            case FlyoutBehavior.Flyout:
                nativeView.IsPaneToggleButtonVisible = true;
                // Workaround for
                // https://github.com/microsoft/microsoft-ui-xaml/issues/6493
                nativeView.PaneDisplayMode = NavigationViewPaneDisplayMode.LeftCompact;
                nativeView.PaneDisplayMode = NavigationViewPaneDisplayMode.LeftMinimal;
                break;

            case FlyoutBehavior.Locked:
                nativeView.PaneDisplayMode           = NavigationViewPaneDisplayMode.Left;
                nativeView.IsPaneToggleButtonVisible = false;
                break;

            case FlyoutBehavior.Disabled:
                nativeView.PaneDisplayMode           = NavigationViewPaneDisplayMode.LeftMinimal;
                nativeView.IsPaneToggleButtonVisible = false;
                nativeView.IsPaneOpen = false;
                break;
            }

            handler.UpdateFlyoutPanelMargin();
        }
        public static void MapToolbar(FlyoutViewHandler handler, IFlyoutView view)
        {
            ViewHandler.MapToolbar(handler, view);

            if (handler.VirtualView.FlyoutBehavior == FlyoutBehavior.Flyout && handler.VirtualView is IToolbarElement te && te.Toolbar?.Handler is ToolbarHandler th)
            {
                th.SetupWithDrawerLayout(handler.DrawerLayout);
            }
        }
        public static void MapFlyoutWidth(FlyoutViewHandler handler, IFlyoutView flyoutView)
        {
            var nativeFlyoutView = handler._flyoutView;

            if (nativeFlyoutView?.LayoutParameters == null)
            {
                return;
            }

            nativeFlyoutView.LayoutParameters.Width = (int)handler.FlyoutWidth;
        }
 public static void MapFlyoutWidth(FlyoutViewHandler handler, IFlyoutView flyoutView)
 {
     if (flyoutView.Width >= 0)
     {
         handler.NativeView.OpenPaneLength = flyoutView.Width;
     }
     else
     {
         handler.NativeView.OpenPaneLength = 320;
     }
     // At some point this Template Setting is going to show up with a bump to winui
     //handler.NativeView.OpenPaneLength = handler.NativeView.TemplateSettings.OpenPaneWidth;
 }
 public static void MapIsGestureEnabled(FlyoutViewHandler handler, IFlyoutView view)
 {
 }
 public static void MapIsPresented(FlyoutViewHandler handler, IFlyoutView flyoutView)
 {
     handler.NativeView.IsPaneOpen = flyoutView.IsPresented;
 }
 public static void MapFlyout(FlyoutViewHandler handler, IFlyoutView flyoutView)
 {
     handler.UpdateFlyout();
 }
 public static void MapDetail(FlyoutViewHandler handler, IFlyoutView flyoutView)
 {
     handler.UpdateDetail();
 }
 public static void MapIsGestureEnabled(FlyoutViewHandler handler, IFlyoutView view)
 {
     handler.UpdateFlyoutBehavior();
 }
 public static void MapIsPresented(FlyoutViewHandler handler, IFlyoutView flyoutView)
 {
     handler.UpdateIsPresented();
 }