示例#1
0
        internal Platform()
        {
            _renderer = new PlatformRenderer(this);
            _modals   = new List <Page>();
            Application.Current.NavigationProxy.Inner = this;

            MessagingCenter.Subscribe(this, Page.AlertSignalName, (Page sender, AlertArguments arguments) => DialogHelper.ShowAlert(PlatformRenderer, arguments));
            MessagingCenter.Subscribe(this, Page.ActionSheetSignalName, (Page sender, ActionSheetArguments arguments) => DialogHelper.ShowActionSheet(PlatformRenderer, arguments));
        }
示例#2
0
        private void AddChild(Page mainPage)
        {
            var viewRenderer = GetRenderer(mainPage);

            if (viewRenderer == null)
            {
                viewRenderer = CreateRenderer(mainPage);
                SetRenderer(mainPage, viewRenderer);

                PlatformRenderer.Add(viewRenderer.Container);
                PlatformRenderer.ShowAll();
            }
        }
示例#3
0
        void IDisposable.Dispose()
        {
            if (_disposed)
            {
                return;
            }

            _disposed = true;

            MessagingCenter.Unsubscribe <Page, ActionSheetArguments>(this, Page.ActionSheetSignalName);
            MessagingCenter.Unsubscribe <Page, AlertArguments>(this, Page.AlertSignalName);
            MessagingCenter.Unsubscribe <Page, bool>(this, Page.BusySetSignalName);

            foreach (var modal in _modals)
            {
                DisposeModelAndChildrenRenderers(modal);
            }
            DisposeModelAndChildrenRenderers(Page);

            PlatformRenderer.Destroy();
        }