/// <summary>
        /// Handler to execute when SettingsPane is requiring for commands
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="args"></param>
        private void MainPage_CommandsRequested(SettingsPane sender, SettingsPaneCommandsRequestedEventArgs args)
        {
            args.Request.ApplicationCommands.Clear();
            var jkCommand = new SettingsCommand("ppolicy", "Política de Privacidad",
                                                (handler) =>
            {
                var settingsHelper = new SettingsWindowHelper();

                //Render WebView contents in brush
                var brush = new WebViewBrush();
                brush.SetSource(WebViewControl);
                brush.Redraw();
                //Fill rectangle with brush texture
                RgWebViewRenderingSurface.Fill = brush;

                WebViewControl.Visibility = Visibility.Collapsed;

                //Show the settings flyout
                //send Action to be executed when Settings window be closed
                settingsHelper.ShowFlyout(new PrivacyPolicyUC(),
                                          () => WebViewControl.Visibility = Visibility.Visible
                                          );
            });

            args.Request.ApplicationCommands.Add(jkCommand);
        }
Exemple #2
0
        protected override void OnAttached()
        {
            System.Windows.Application.Current.Exit += Current_Exit;
            base.OnAttached();

            _settingsWindowHelper = Bootstrapper.Container.GetExportedValue <SettingsWindowHelper>();
            SetupTrayIcon();
        }
        /// <summary>
        /// Handler to execute when SettingsPane is requiring for commands
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="args"></param>
        private void MainPage_CommandsRequested(SettingsPane sender, SettingsPaneCommandsRequestedEventArgs args)
        {
            args.Request.ApplicationCommands.Clear();
            var jkCommand = new SettingsCommand("ppolicy", "Política de Privacidad",
                                                (handler) =>
                                                {
                                                    var settingsHelper = new SettingsWindowHelper();
                                                    
                                                    //Render WebView contents in brush
                                                    var brush = new WebViewBrush();
                                                    brush.SetSource(WebViewControl);
                                                    brush.Redraw();
                                                    //Fill rectangle with brush texture
                                                    RgWebViewRenderingSurface.Fill = brush;

                                                    WebViewControl.Visibility = Visibility.Collapsed;

                                                    //Show the settings flyout
                                                    //send Action to be executed when Settings window be closed
                                                    settingsHelper.ShowFlyout(new PrivacyPolicyUC(),
                                                            () => WebViewControl.Visibility = Visibility.Visible
                                                        );
                                                });

            args.Request.ApplicationCommands.Add(jkCommand);
        }