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