Ejemplo n.º 1
0
        public static FlowDirection GetFlowDirection(this IMauiContext mauiContext)
        {
            var window = mauiContext.GetPlatformWindow();

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

            return(window.EffectiveUserInterfaceLayoutDirection.ToFlowDirection());
        }
Ejemplo 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);
            }
        }
Ejemplo 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;
            }
        }
Ejemplo 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));
        }
Ejemplo n.º 5
0
 public static ModalStack GetModalStack(this IMauiContext mauiContext) =>
 mauiContext.GetPlatformWindow().GetModalStack();
Ejemplo n.º 6
0
 public static ELayout GetPlatformParent(this IMauiContext mauiContext) =>
 mauiContext.GetPlatformWindow().GetBaseLayout();