예제 #1
0
파일: App.xaml.cs 프로젝트: sriki77/gotray
        private void OnSettingCommand(IUICommand command)
        {
            // Create a Popup window which will contain our flyout.
            settingsPopup                       = new Popup();
            settingsPopup.Closed               += OnPopupClosed;
            Window.Current.Activated           += OnWindowActivated;
            settingsPopup.IsLightDismissEnabled = true;
            double settingsWidth = 346;

            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
            });


            var mypane = new GoTraySettings();

            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;
        }
예제 #2
0
파일: App.xaml.cs 프로젝트: sriki77/gotray
        private void OnSettingCommand(IUICommand command)
        {
            // Create a Popup window which will contain our flyout.
            settingsPopup = new Popup();
            settingsPopup.Closed += OnPopupClosed;
            Window.Current.Activated += OnWindowActivated;
            settingsPopup.IsLightDismissEnabled = true;
            double settingsWidth = 346;
            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
                });

            var mypane = new GoTraySettings();

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