void onSettingsCommand(IUICommand command) { SettingsCommand settingsCommand = (SettingsCommand)command; // Create a Popup window which will contain our flyout. settingsPopup = new Popup(); settingsPopup.Closed += OnPopupClosed; Window.Current.Activated += OnWindowActivated; settingsPopup.IsLightDismissEnabled = true; settingsPopup.Width = settingsWidth; settingsPopup.Height = windowBounds.Height; //settingsPopup.Height = Window.Current.Bounds.Height; // Add the proper animations for the flyout settingsPopup.ChildTransitions = new Windows.UI.Xaml.Media.Animation.TransitionCollection(); settingsPopup.ChildTransitions.Add(new Windows.UI.Xaml.Media.Animation.PaneThemeTransition() { Edge = (SettingsPane.Edge == SettingsEdgeLocation.Right) ? EdgeTransitionLocation.Right : EdgeTransitionLocation.Left }); // Create a SettingsFlyout the same dimensions as the Popup. Settings.SettingsFlyout mypane = new Settings.SettingsFlyout(); mypane.Width = settingsWidth; mypane.Height = windowBounds.Height; //mypane.Height = Window.Current.Bounds.Height; // Place the SettingsFlyout inside out Popup window. settingsPopup.Child = mypane; // Define the location of our Popup settingsPopup.SetValue(Canvas.LeftProperty, SettingsPane.Edge == SettingsEdgeLocation.Right ? (windowBounds.Width - settingsWidth) : 0); settingsPopup.SetValue(Canvas.TopProperty, 0); // now, after all that stuff, open the Flyout settingsPopup.IsOpen = true; }