Example #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;
            }
        }
Example #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);
            }
        }
Example #3
0
 protected PopupPage()
 {
     _popupInit = new PopupPageInitializer(this);
     Popups     = new ObservableCollection <Popup>();
     Popups.CollectionChanged += Popups_CollectionChanged;
 }