public static FlowDirection GetFlowDirection(this IMauiContext mauiContext)
        {
            var window = mauiContext.GetPlatformWindow();

            if (window == null)
            {
                return(FlowDirection.LeftToRight);
            }

            return(window.EffectiveUserInterfaceLayoutDirection.ToFlowDirection());
        }
Esempio n. 2
0
        internal void Unsubscribe(Window window)
        {
            IMauiContext mauiContext  = window?.MauiContext;
            EWindow      nativeWindow = mauiContext.GetPlatformWindow();

            var toRemove = Subscriptions.Where(s => s.Window == nativeWindow).ToList();

            foreach (AlertRequestHelper alertRequestHelper in toRemove)
            {
                alertRequestHelper.Dispose();
                Subscriptions.Remove(alertRequestHelper);
            }
        }
Esempio n. 3
0
        void OnApplyTemplateFinished(object?sender, EventArgs e)
        {
            if (_rootView.AppTitleBar != null)
            {
                var platformWindow = _mauiContext.GetPlatformWindow();
                platformWindow.ExtendsContentIntoTitleBar = true;
                UpdateAppTitleBar(true);
            }

            if (_rootView.NavigationViewControl != null)
            {
                _rootView.NavigationViewControl.HeaderControl = _toolbar;
            }
        }
Esempio n. 4
0
        internal void Subscribe(Window window)
        {
            IMauiContext mauiContext    = window?.MauiContext;
            EWindow      platformWindow = mauiContext.GetPlatformWindow();

            if (mauiContext == null || platformWindow == null)
            {
                return;
            }

            if (Subscriptions.Any(s => s.Window == platformWindow))
            {
                return;
            }

            Subscriptions.Add(new AlertRequestHelper(platformWindow, mauiContext));
        }
Esempio n. 5
0
 public static ModalStack GetModalStack(this IMauiContext mauiContext) =>
 mauiContext.GetPlatformWindow().GetModalStack();
Esempio n. 6
0
 public static ELayout GetPlatformParent(this IMauiContext mauiContext) =>
 mauiContext.GetPlatformWindow().GetBaseLayout();