コード例 #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;
        }