コード例 #1
0
        void InternalSetPage(Page page)
        {
            if (!Forms.IsInitialized)
            {
                throw new InvalidOperationException("Call Forms.Init (Activity, Bundle) before this");
            }

            if (Platform != null)
            {
                Platform.SetPage(page);
                return;
            }

            PopupManager.ResetBusyCount(this);

            Platform = new AppCompat.Platform(this);
            Platform.SetPage(page);
            _layout.AddView(Platform);
            _layout.BringToFront();
        }
コード例 #2
0
ファイル: PageExtensions.cs プロジェクト: zhamppx97/maui
#pragma warning restore 618

        public static Fragment CreateSupportFragment(this ContentPage view, Context context)
        {
            if (!Forms.IsInitialized)
            {
                throw new InvalidOperationException("call Forms.Init() before this");
            }

            if (!(view.RealParent is Application))
            {
                Application app = new DefaultApplication();
                app.MainPage = view;
            }

            var platform = new AppCompat.Platform(context, true);

            platform.SetPage(view);

            var vg = platform.GetViewGroup();

            return(new EmbeddedSupportFragment(vg, platform));
        }