void InternalSetPage(Page page)
        {
            if (!Forms.IsInitialized)
            {
                throw new InvalidOperationException("Call Forms.Init (Activity, Bundle) before this");
            }

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

            _busyCount = 0;
            MessagingCenter.Subscribe <Page, bool>(this, Page.BusySetSignalName, OnPageBusy);
            MessagingCenter.Subscribe <Page, AlertArguments>(this, Page.AlertSignalName, OnAlertRequested);
            MessagingCenter.Subscribe <Page, ActionSheetArguments>(this, Page.ActionSheetSignalName, OnActionSheetRequested);

            _platform = new AppCompat.Platform(this);
            if (_application != null)
            {
                _application.Platform = _platform;
            }
            _platform.SetPage(page);
            _layout.AddView(_platform);
            _layout.BringToFront();
        }
Exemple #2
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();
		}
Exemple #3
0
#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));
        }