/// <summary>
        /// This the event handler for the "Defaults" button added to the settings charm. This method
        /// is responsible for creating the Popup window will use as the container for our settings Flyout.
        /// The reason we use a Popup is that it gives us the "light dismiss" behavior that when a user clicks away
        /// from our custom UI it just dismisses.  This is a principle in the Settings experience and you see the
        /// same behavior in other experiences like AppBar.
        /// </summary>
        /// <param name="command"></param>
        void onSettingsCommand(IUICommand command)
        {
            rootPage.NotifyUser("Defaults command invoked", NotifyType.StatusMessage);

            // 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;

            // Add the proper animation for the panel.
            settingsPopup.ChildTransitions = new TransitionCollection();
            settingsPopup.ChildTransitions.Add(new PaneThemeTransition()
            {
                Edge = (SettingsPane.Edge == SettingsEdgeLocation.Right) ?
                       EdgeTransitionLocation.Right :
                       EdgeTransitionLocation.Left
            });

            // Create a SettingsFlyout the same dimenssions as the Popup.
            SettingsFlyout mypane = new SettingsFlyout();

            mypane.Width  = settingsWidth;
            mypane.Height = windowBounds.Height;

            // Place the SettingsFlyout inside our Popup window.
            settingsPopup.Child = mypane;

            // Let's define the location of our Popup.
            settingsPopup.SetValue(Canvas.LeftProperty, SettingsPane.Edge == SettingsEdgeLocation.Right ? (windowBounds.Width - settingsWidth) : 0);
            settingsPopup.SetValue(Canvas.TopProperty, 0);
            settingsPopup.IsOpen = true;
        }
Example #2
0
 /// <summary>
 /// This the event handler for the "Defaults" button added to the settings charm. This method
 /// is responsible for creating the Popup window will use as the container for our settings Flyout.
 /// The reason we use a Popup is that it gives us the "light dismiss" behavior that when a user clicks away 
 /// from our custom UI it just dismisses.  This is a principle in the Settings experience and you see the
 /// same behavior in other experiences like AppBar. 
 /// </summary>
 /// <param name="command"></param>
 void onSettingsCommand(IUICommand command)
 {
   
     // Create a SettingsFlyout the same dimensions as the Popup.
     SettingsFlyout mypane = new SettingsFlyout();
    
     CreateFlyout(mypane);
 }