Пример #1
0
 public static void MapIsPresented(IFlyoutViewHandler handler, IFlyoutView flyoutView)
 {
     if (handler is FlyoutViewHandler platformHandler)
     {
         platformHandler.UpdateIsPresented();
     }
 }
Пример #2
0
 public static void MapIsGestureEnabled(IFlyoutViewHandler handler, IFlyoutView view)
 {
     if (handler is FlyoutViewHandler platformHandler)
     {
         platformHandler.UpdateFlyoutBehavior();
     }
 }
Пример #3
0
 public static void MapDetail(IFlyoutViewHandler handler, IFlyoutView flyoutView)
 {
     if (handler is FlyoutViewHandler platformHandler)
     {
         platformHandler.UpdateDetail();
     }
 }
Пример #4
0
 public static void MapFlyoutBehavior(IFlyoutViewHandler handler, IFlyoutView flyoutView)
 {
     if (handler is FlyoutViewHandler platformHandler)
     {
         platformHandler.UpdateFlyoutBehavior();
     }
 }
Пример #5
0
        static void UpdateFlyout(IFlyoutViewHandler handler)
        {
            _ = handler.MauiContext ?? throw new InvalidOperationException($"{nameof(MauiContext)} should have been set by base class.");
            _ = handler.VirtualView.Flyout.ToPlatform(handler.MauiContext);

            handler.PlatformView.ReplacePaneMenuItemsWithCustomContent(handler.VirtualView.Flyout);
        }
Пример #6
0
        static void UpdateDetail(IFlyoutViewHandler handler)
        {
            _ = handler.MauiContext ?? throw new InvalidOperationException($"{nameof(MauiContext)} should have been set by base class.");
            _ = handler.VirtualView.Detail.ToPlatform(handler.MauiContext);

            handler.PlatformView.Content = handler.VirtualView.Detail.ToPlatform();
        }
Пример #7
0
        public static void MapToolbar(IFlyoutViewHandler handler, IFlyoutView view)
        {
            ViewHandler.MapToolbar(handler, view);

            if (handler is FlyoutViewHandler platformHandler &&
                handler.VirtualView.FlyoutBehavior == FlyoutBehavior.Flyout &&
                handler.VirtualView is IToolbarElement te &&
                te.Toolbar?.Handler is ToolbarHandler th)
            {
                th.SetupWithDrawerLayout(platformHandler.DrawerLayout);
            }
        }
Пример #8
0
        static void UpdateFlyout(IFlyoutViewHandler handler)
        {
            _ = handler.MauiContext ?? throw new InvalidOperationException($"{nameof(MauiContext)} should have been set by base class.");
            _ = handler.VirtualView.Flyout.ToPlatform(handler.MauiContext);

            if (handler.PlatformView is RootNavigationView rnv)
            {
                rnv.FlyoutView = handler.VirtualView.Flyout;
            }

            handler.PlatformView.FlyoutCustomContent = handler.VirtualView.Flyout?.ToPlatform(handler.MauiContext);
        }
Пример #9
0
        public static void MapFlyoutWidth(IFlyoutViewHandler handler, IFlyoutView flyoutView)
        {
            if (handler is FlyoutViewHandler platformHandler)
            {
                var nativeFlyoutView = platformHandler._flyoutView;
                if (nativeFlyoutView?.LayoutParameters == null)
                {
                    return;
                }

                nativeFlyoutView.LayoutParameters.Width = (int)platformHandler.FlyoutWidth;
            }
        }
Пример #10
0
 public static void MapFlyoutWidth(IFlyoutViewHandler handler, IFlyoutView flyoutView)
 {
     if (flyoutView.Width >= 0)
     {
         handler.PlatformView.OpenPaneLength = flyoutView.Width;
     }
     else
     {
         handler.PlatformView.OpenPaneLength = 320;
     }
     // At some point this Template Setting is going to show up with a bump to winui
     //handler.PlatformView.OpenPaneLength = handler.PlatformView.TemplateSettings.OpenPaneWidth;
 }
Пример #11
0
 public static void MapIsGestureEnabled(IFlyoutViewHandler handler, IFlyoutView view)
 {
 }
Пример #12
0
 public static void MapFlyoutBehavior(IFlyoutViewHandler handler, IFlyoutView flyoutView)
 {
     handler.PlatformView.UpdateFlyoutBehavior(flyoutView);
 }
Пример #13
0
 public static void MapIsPresented(IFlyoutViewHandler handler, IFlyoutView flyoutView)
 {
     handler.PlatformView.IsPaneOpen = flyoutView.IsPresented;
 }
Пример #14
0
 public static void MapFlyout(IFlyoutViewHandler handler, IFlyoutView flyoutView)
 {
     UpdateFlyout(handler);
 }
Пример #15
0
 public static void MapDetail(IFlyoutViewHandler handler, IFlyoutView flyoutView)
 {
     UpdateDetail(handler);
 }