private void EditPeriod_Button_Click(object sender, RoutedEventArgs e) { _editingPeriod = false; _editedPeriod = null; if ((App.isSnapped()) && (PeriodListSnapped.SelectedIndex >= 0)) { EditPeriod_Context_Change(PeriodListSnapped); } else { // create the page PCalender.Views.EditView editView = new Views.EditView(this); // close the settings bar SettingsAppBar.IsOpen = false; // add all the periods to the internal list Add_PeriodsToList(editView.PeriodList); // pop the settings pane editPopup = Utilities.MainPage.ShowPopup(editView, Window.Current.Bounds.Height, "Edit Period"); } }
public static Utilities.SettingsFlyout ShowPopup(Page pageToShow, double height, string titleText) { _settingsPopup = new Popup(); _settingsPopup.Closed += OnPopupClosed; Window.Current.Activated += OnWindowActivated; _settingsPopup.IsLightDismissEnabled = true; _settingsPopup.Width = _settingsWidth; _settingsPopup.Height = _windowBounds.Height; Utilities.SettingsFlyout mypane = new Utilities.SettingsFlyout(); mypane.Width = _settingsWidth; mypane.Height = height; mypane.InnerGrid.Children.Add(pageToShow); mypane.TitleText = titleText; mypane.Theme = SettingsFlyout.FlyoutTheme.Gray; _settingsPopup.Child = mypane; _settingsPopup.SetValue(Canvas.LeftProperty, _windowBounds.Width - _settingsWidth); _settingsPopup.SetValue(Canvas.TopProperty, 0); _settingsPopup.IsOpen = true; return(mypane); }