Exemplo n.º 1
0
        private void CheckInit(ContentPage page = null, bool lateInit = false)
        {
            if (initialized)
            {
                return;
            }
            if (page == null)
            {
                page = this.FindParent <ContentPage>();
            }
            if (page != null)
            {
                var init = PopupPageInitializer.GetPopUpInitializer(page, popup, lateInit);

                if (lateInit)
                {
                    init.LateInit();
                }

                initialized = true;
            }
        }
Exemplo n.º 2
0
        public static PopupPageInitializer GetPopUpInitializer(ContentPage page, Popup popup, bool lateInit)
        {
            if (cache.ContainsKey(page))
            {
                var init = cache[page];
                init.Add(popup);
                return(init);
            }
            else
            {
                if (lateInit)
                {
                    throw new PopUpNotInitializedException();
                }

                var init = new PopupPageInitializer(page);
                if (popup != null)
                {
                    init.Add(popup);
                }
                cache.Add(page, init);
                return(init);
            }
        }
Exemplo n.º 3
0
 protected PopupPage()
 {
     _popupInit = new PopupPageInitializer(this);
     Popups     = new ObservableCollection <Popup>();
     Popups.CollectionChanged += Popups_CollectionChanged;
 }