Exemple #1
0
#pragma warning restore 618

        void IDisposable.Dispose()
        {
            if (_disposed)
            {
                return;
            }
            _disposed = true;

            SetPage(null);

            if (_embedded)
            {
                PopupManager.Unsubscribe(_context);
            }

            FormsApplicationActivity.BackPressed -= HandleBackPressed;
            _toolbarTracker.CollectionChanged    -= ToolbarTrackerOnCollectionChanged;
            _toolbarTracker.Target = null;

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

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

            PopupManager.ResetBusyCount(this);

            _canvas = new Platform(this);
            if (_application != null)
            {
                _application.Platform = _canvas;
            }
            _canvas.SetPage(page);
            _layout.AddView(_canvas.GetViewGroup());
        }
        protected override void OnDestroy()
        {
            PreviousActivityDestroying.Reset();

            if (_application != null)
            {
                _application.PropertyChanging -= AppOnPropertyChanging;
                _application.PropertyChanged  -= AppOnPropertyChanged;
            }

            PopupManager.Unsubscribe(this);

            if (Platform != null)
            {
                _layout.RemoveView(Platform);
                Platform.Dispose();
            }

            PreviousActivityDestroying.Set();

            // call at the end to avoid race conditions with Platform dispose
            base.OnDestroy();
        }
Exemple #4
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);
            if (_application != null)
            {
                _application.Platform = Platform;
            }
            Platform.SetPage(page);
            _layout.AddView(Platform);
            _layout.BringToFront();
        }
Exemple #5
0
 protected FormsAppCompatActivity()
 {
     _previousState = AndroidApplicationLifecycleState.Uninitialized;
     _currentState  = AndroidApplicationLifecycleState.Uninitialized;
     PopupManager.Subscribe(this);
 }