///////////////////////////////////////////////////////////////////////////////////
        // Update with URLs to About, Support and Privacy Policy Web Pages
        ///////////////////////////////////////////////////////////////////////////////////
        void settingsPane_CommandsRequested(SettingsPane sender, SettingsPaneCommandsRequestedEventArgs args)
        {
            var rl = new ResourceLoader();

            var aboutCmd = new SettingsCommand("About", rl.GetString("SETTINGS_PANEL_CMD_ABOUT"), async (x) =>
            {
                await Launcher.LaunchUriAsync(new Uri(""));
            });

            args.Request.ApplicationCommands.Add(aboutCmd);

            var supportCmd = new SettingsCommand("Support", rl.GetString("SETTINGS_PANEL_CMD_SUPPORT"), async (x) =>
            {
                await Launcher.LaunchUriAsync(new Uri(""));
            });

            args.Request.ApplicationCommands.Add(supportCmd);

            var policyCmd = new SettingsCommand("PrivacyPolicy", rl.GetString("SETTINGS_PANEL_CMD_PRIVACY_POLICY"), async (x) =>
            {
                await Launcher.LaunchUriAsync(new Uri(""));
            });

            args.Request.ApplicationCommands.Add(policyCmd);
        }
Esempio n. 2
0
        void CommandsRequested(SettingsPane sender, SettingsPaneCommandsRequestedEventArgs args)
        {
            UICommandInvokedHandler handler = new UICommandInvokedHandler(onSettingsCommand);

            SettingsCommand policyCommand = new SettingsCommand("policyCommand", "Privacy Policy", handler);
            args.Request.ApplicationCommands.Add(policyCommand);
        }
void BlankPage_CommandsRequested(SettingsPane sender, SettingsPaneCommandsRequestedEventArgs args)
{
    // 新建一个命令
    SettingsCommand cmd = new SettingsCommand("login", "登录", (x) =>
    {
        // 新建一个Popup,并将其宽度设置为346,高度与屏幕一致
        _settingsPopup = new Popup();
        _settingsPopup.Width = 346;
        _settingsPopup.Height = Window.Current.Bounds.Height;
        _settingsPopup.IsLightDismissEnabled = true;

        // 新建一个页面,并设置该页面的相关属性(大小,位置)
        LoginPane mypane = new LoginPane();
        mypane.Height = Window.Current.Bounds.Height;
        mypane.Width = 346;
        _settingsPopup.Child = mypane;
        _settingsPopup.SetValue(Canvas.LeftProperty, Window.Current.Bounds.Width - 346);
        _settingsPopup.IsOpen = true;
    });

    args.Request.ApplicationCommands.Add(cmd);

    SettingsCommand cmd1 = new SettingsCommand("logout", "注销", (x) =>
    {
    });

    args.Request.ApplicationCommands.Add(cmd1);
}
Esempio n. 4
0
 private void CommandsRequested(SettingsPane sender, SettingsPaneCommandsRequestedEventArgs args) {
     SettingsCommand about = new SettingsCommand("About", "About", About_Click);
     SettingsCommand privacy = new SettingsCommand("Privacy", "Privacy Policy", PrivacyPolicy_Click);
     SettingsCommand history = new SettingsCommand("History", "Clear History", ClearHistory_Click);
     args.Request.ApplicationCommands.Add(about);
     args.Request.ApplicationCommands.Add(privacy);
     args.Request.ApplicationCommands.Add(history); }
Esempio n. 5
0
        private void BlankPage_CommandsRequested(SettingsPane sender, SettingsPaneCommandsRequestedEventArgs args)
        {
            SettingsCommand cmd = new SettingsCommand("sample", "Sample Custom Setting", (x) =>
            {
                SettingsFlyout settings = new SettingsFlyout();
                settings.FlyoutWidth = (Callisto.Controls.SettingsFlyout.SettingsFlyoutWidth)Enum.Parse(typeof(Callisto.Controls.SettingsFlyout.SettingsFlyoutWidth), settingswidth.SelectionBoxItem.ToString());
                //settings.HeaderBrush = new SolidColorBrush(Colors.Orange);
                settings.HeaderText = "Foo Bar Setting";

                BitmapImage bmp = new BitmapImage(new Uri("ms-appx:///Assets/SmallLogo.png"));

                settings.SmallLogoImageSource = bmp;

                ToggleSwitch ts = new ToggleSwitch();
                ts.Header = "Download updates automatically";

                settings.Content = ts;

                settings.IsOpen = true;

                ObjectTracker.Track(settings);
            });

            args.Request.ApplicationCommands.Add(cmd);
        }
        // <snippet519>
        public void OnCommandsRequested(SettingsPane sender, SettingsPaneCommandsRequestedEventArgs args)
        {
            if (args == null || args.Request == null || args.Request.ApplicationCommands == null
                || _getSettingsCharmItems == null)
            {
                return;
            }

            var applicationCommands = args.Request.ApplicationCommands;
            var settingsCharmItems = _getSettingsCharmItems();

            foreach (var settingsCharmItem in settingsCharmItems)
            {
                var notFound = applicationCommands.FirstOrDefault(
                    (settingsCommand) => settingsCommand.Id.ToString() == settingsCharmItem.FlyoutName) == null;
                if (notFound)
                {
                    SettingsCommand cmd = new SettingsCommand(settingsCharmItem.FlyoutName,
                                                              settingsCharmItem.SettingsCharmTitle,
                                                              (o) =>
                                                              _flyoutService.ShowFlyout(settingsCharmItem.FlyoutName));
                                                                  
                    applicationCommands.Add(cmd);
                }
            }
        }
Esempio n. 7
0
        private void BlankPage_CommandsRequested(SettingsPane sender, SettingsPaneCommandsRequestedEventArgs args)
        {
            SettingsCommand cmd = new SettingsCommand("sample", "Sample Custom Setting", (x) =>
            {
                // create a new instance of the flyout
                SettingsFlyout settings = new SettingsFlyout();
                // set the desired width.  If you leave this out, you will get Narrow (346px)
                settings.FlyoutWidth = (Callisto.Controls.SettingsFlyout.SettingsFlyoutWidth)Enum.Parse(typeof(Callisto.Controls.SettingsFlyout.SettingsFlyoutWidth), settingswidth.SelectionBoxItem.ToString());

                // optionally change header and content background colors away from defaults (recommended)
                // if using Callisto's AppManifestHelper you can grab the element from some member var you held it in
                // settings.HeaderBrush = new SolidColorBrush(App.VisualElements.BackgroundColor);
                settings.HeaderBrush = new SolidColorBrush(Colors.Orange);
                settings.HeaderText = string.Format("{0} Custom Settings", App.VisualElements.DisplayName);

                // provide some logo (preferrably the smallogo the app uses)
                BitmapImage bmp = new BitmapImage(App.VisualElements.SmallLogoUri);
                settings.SmallLogoImageSource = bmp;

                // set the content for the flyout
                settings.Content = new SettingsContent();

                // open it
                settings.IsOpen = true;

                // this is only for the test app and not needed
                // you would not use this code in your real app
                ObjectTracker.Track(settings);
            });

            args.Request.ApplicationCommands.Add(cmd);
        }
        void GroupedItemsPage_CommandsRequested(Windows.UI.ApplicationSettings.SettingsPane sender, Windows.UI.ApplicationSettings.SettingsPaneCommandsRequestedEventArgs args)
        {
            
             
                SettingsCommand cmd = new SettingsCommand("Accounts", "Account", (x) =>
                    {
                        _settingsPopup = new Popup();
                        _settingsPopup.Closed += OnPopupClosed;
                        Window.Current.Activated += OnWindowActivated;
                        _settingsPopup.IsLightDismissEnabled = true;
                        _settingsPopup.Width = _settingsWidth;
                        _settingsPopup.Height = _windowBounds.Height;

                        SimpleSettingsNarrow mypane = new SimpleSettingsNarrow();
                        mypane.Width = _settingsWidth;
                        mypane.Height = _windowBounds.Height;

                        _settingsPopup.Child = mypane;
                        _settingsPopup.SetValue(Canvas.LeftProperty, _windowBounds.Width - _settingsWidth);
                        _settingsPopup.SetValue(Canvas.TopProperty, 0);
                        _settingsPopup.IsOpen = true;
                    });

                args.Request.ApplicationCommands.Add(cmd);
            

        }
Esempio n. 9
0
 private void OnCommandsRequested(SettingsPane sender, SettingsPaneCommandsRequestedEventArgs args)
 {
     var menuCommand = new SettingsCommand("handwritingSettings", "Handwriting options", OnHandwritingSettingsCommand);
     args.Request.ApplicationCommands.Add(menuCommand);
     menuCommand = new SettingsCommand("about", "About", OnAboutCommand);
     args.Request.ApplicationCommands.Add(menuCommand);
 }
Esempio n. 10
0
        private void SettingsCommandRequested(SettingsPane sender, SettingsPaneCommandsRequestedEventArgs args)
        {
            var privacyCommand = new SettingsCommand("privacy", Strings.PrivacyStatement,
                async h => await Launcher.LaunchUriAsync(new Uri("http://videolan.org/vlc/privacy.html")));

            var specialThanks = new SettingsCommand("specialThanks", Strings.SpecialThanks,
                command =>
                {
                    Locator.NavigationService.Go(VLCPage.SpecialThanksPage);
                });

            var settings = new SettingsCommand("settings", Strings.Settings,
                command =>
                {
                    Locator.NavigationService.Go(VLCPage.SettingsPage);
                });
            var license = new SettingsCommand("license", Strings.License, command =>
            {
                Locator.NavigationService.Go(VLCPage.LicensePage);
            });
            args.Request.ApplicationCommands.Clear();
            args.Request.ApplicationCommands.Add(privacyCommand);
            args.Request.ApplicationCommands.Add(specialThanks);
            args.Request.ApplicationCommands.Add(settings);
            args.Request.ApplicationCommands.Add(license);
        }
Esempio n. 11
0
        private void SetCommandsRequested(SettingsPane sender, SettingsPaneCommandsRequestedEventArgs args)
        {
            SettingsCommand cmd = new SettingsCommand(
                 "sample",
                 "Feedback",
                 (x) =>
                 {
                     // create a new instance of the flyout
                     SettingsFlyout settings = new SettingsFlyout();
                     settings.Title = "Provide Feedback";
                     BitmapImage bitmap = new BitmapImage(new Uri("ms-appx:///Assets/SmallLogo.png"));
                     settings.IconSource = bitmap;

                     // set the content for the flyout
                     var settingsContent = new FeedbackContent();
                     settingsContent.FeedbackSent += (s, e) =>
                     {
                         settings.Hide();
                     };

                     settings.HorizontalContentAlignment = Windows.UI.Xaml.HorizontalAlignment.Stretch;
                     settings.Content = settingsContent;

                     // open it
                     settings.Show();
                 });

            args.Request.ApplicationCommands.Add(cmd);
        }
Esempio n. 12
0
        private void ConfigureSettings(SettingsPane sender, SettingsPaneCommandsRequestedEventArgs args)
        {
            var settingsColor = App.Current.Resources["MainAppColor"] as SolidColorBrush;

            var aboutCommand = new SettingsCommand("about", "About MetroPass", a => DialogService.ShowSettingsFlyout<AboutSettingsViewModel>(headerBrush: settingsColor));
            args.Request.ApplicationCommands.Add(aboutCommand);

            var dataSource = _bootstrapper.GetInstance<IPWDatabaseDataSource>();
            var dbOptionsCommand = new SettingsCommand("databaseOptions", "Database Options", h =>
            {
                if (dataSource.PwDatabase != null)
                {
                    DialogService.ShowSettingsFlyout<DatabaseSettingsViewModel>( onClosed: SettingsClosed, headerBrush: settingsColor);
                }
                else
                {
                    DialogService.ShowSettingsFlyout<DatabaseClosedSettingsViewModel>(headerBrush: settingsColor);
                }
            });
            args.Request.ApplicationCommands.Add(dbOptionsCommand);

            var appOptionsCommand = new SettingsCommand("metroPassOptions", "MetroPass Options", h => DialogService.ShowSettingsFlyout<AppSettingsViewModel>( headerBrush: settingsColor));
            args.Request.ApplicationCommands.Add(appOptionsCommand);

            var privacyPolicyCommand = new SettingsCommand("privacyPolicy", "Privacy Policy", a => LaunchUrl(PrivacyPolicyUrl));
            args.Request.ApplicationCommands.Add(privacyPolicyCommand);

            var supportCommand = new SettingsCommand("support", "Support & Feedback", a => LaunchUrl(SupportUrl));
            args.Request.ApplicationCommands.Add(supportCommand);

        }
Esempio n. 13
0
        protected override void OnWindowCreated(WindowCreatedEventArgs args)
        {
            SettingsPane.GetForCurrentView().CommandsRequested += (s, e) =>
            {
                var generalSettingCmd = new SettingsCommand("general", "General", handler =>
                {
                    var sf = new AppSettingsFlyout();
                    sf.Show();
                });
                var aboutSettingCmd = new SettingsCommand("about", "About", handler =>
                {
                    var about = new AboutSettingFlyout();
                    about.Show();
                });
                var ppSettingCmd = new SettingsCommand("pp", "Privacy Policy", handler =>
                {
                    Windows.System.Launcher.LaunchUriAsync(new Uri("http://sinhpham.github.io/PhotoGlider/"));
                });
                e.Request.ApplicationCommands.Add(generalSettingCmd);
                e.Request.ApplicationCommands.Add(aboutSettingCmd);
                e.Request.ApplicationCommands.Add(ppSettingCmd);
            };

            base.OnWindowCreated(args);
        }
Esempio n. 14
0
        private void SettingsCommandsRequested(SettingsPane sender, SettingsPaneCommandsRequestedEventArgs args)
        {
            var privacyStatement = new SettingsCommand("privacy", "Privacy Statement", x => Launcher.LaunchUriAsync(
                    new Uri("https://www.radiorivendell.com/page/terms-of-use/")));

            args.Request.ApplicationCommands.Clear();
            args.Request.ApplicationCommands.Add(privacyStatement);
        }
Esempio n. 15
0
 void MainPage_CommandsRequested(SettingsPane sender, SettingsPaneCommandsRequestedEventArgs args)
 {
     UICommandInvokedHandler invokedHandler =
                                 new UICommandInvokedHandler(AboutInvokedHandler);
     SettingsCommand aboutCommand = new SettingsCommand("About", "About Jimmy's Comics",
                                               invokedHandler);
     args.Request.ApplicationCommands.Add(aboutCommand);
 }
Esempio n. 16
0
        private void SettingsCommandsRequested(SettingsPane sender, SettingsPaneCommandsRequestedEventArgs args)
        {
            var privacyStatement = new SettingsCommand("privacy", "Privacy Statement", x => Launcher.LaunchUriAsync(
                    new Uri("https://docs.google.com/document/pub?id=1-vYAN6x83MAT1bgbXPS3U2_ATbXCUN5_8QTmHNTyefI")));

            args.Request.ApplicationCommands.Clear();
            args.Request.ApplicationCommands.Add(privacyStatement);
        }
Esempio n. 17
0
 void GroupedItemsPage_CommandsRequested(SettingsPane sender, SettingsPaneCommandsRequestedEventArgs args)
 {
     var viewAboutPage = new SettingsCommand("", "Privacy Statement", cmd =>
     {
         Launcher.LaunchUriAsync(new Uri("http://wintheweb.ru/openprivacy.html", UriKind.Absolute));
     });
     args.Request.ApplicationCommands.Add(viewAboutPage);
 }
Esempio n. 18
0
        private void SettingsCommandsRequested(SettingsPane sender, SettingsPaneCommandsRequestedEventArgs args)
        {
            var privacyStatement = new SettingsCommand("privacy", "Privacy Statement", x => Windows.System.Launcher.LaunchUriAsync(
                    new Uri("http://craigmart.in/hero-helper/privacy-policy/")));

            args.Request.ApplicationCommands.Clear();
            args.Request.ApplicationCommands.Add(privacyStatement);
        }
        private void settingsPane_CommandsRequested(SettingsPane sender, SettingsPaneCommandsRequestedEventArgs args)
        {
            var ConfigHandler = new UICommandInvokedHandler(onConfigCommand);

            var loader = new ResourceLoader();
            var configurationCommand = new SettingsCommand(loader.GetString("Settings"), loader.GetString("Settings"), ConfigHandler);
            args.Request.ApplicationCommands.Add(configurationCommand);
        }
 private void ShowSettings()
 {
     var settings = SettingsPane.GetForCurrentView();
     //adding a custom command to the application settings window
     var command = new SettingsCommand(KnownSettingsCommand.Preferences, ShowPreferences);
     settings.ApplicationCommands.Add(command);
     SettingsPane.Show();
 }
Esempio n. 21
0
 private void MainPage_CommandsRequested(SettingsPane sender, SettingsPaneCommandsRequestedEventArgs args)
 {
     SettingsCommand cmd = new SettingsCommand("KarliCardsSettings", "Game Options", (x) =>
       {
     SettingsPanel.Height = Window.Current.Bounds.Height;
     SettingsPanel.Margin = new Thickness(0, 0, 0, 0);
       });
       args.Request.ApplicationCommands.Add(cmd);
 }
 private void OnSettingsRequested(IList<SettingsCommand> commands)
 {
     SettingsCommand settingsCommand = new SettingsCommand("FeedsSetting", "Feeds", (x) =>
     {
         var view = new SettingsView();
         view.Show();
     });
     commands.Add(settingsCommand);
 }
Esempio n. 23
0
    private void App_CommandsRequested(SettingsPane sender, SettingsPaneCommandsRequestedEventArgs args)
    {

         var privateCommand = new SettingsCommand("Privacy",
                                                 "隐私声明",
                                                  delegate { Launcher.LaunchUriAsync(new Uri("http://blog.iliyang.cn/", UriKind.RelativeOrAbsolute)); });

          args.Request.ApplicationCommands.Add(privateCommand);
   }
        void MainPage_CommandsRequested(SettingsPane sender, SettingsPaneCommandsRequestedEventArgs args)
        {
            args.Request.ApplicationCommands.Clear();

            var _privacy = new SettingsCommand("privacy policy", "Privacy Policy", OpenPrivacyPolicy);
            args.Request.ApplicationCommands.Add(_privacy);

            var _useridpage = new SettingsCommand("userid", "User Name", OpenUserIDPage);
            args.Request.ApplicationCommands.Add(_useridpage);
        }
        ///////////////////////////////////////////////////////////////////////////////////
        // Update with URLs to About, Support and Privacy Policy Web Pages
        ///////////////////////////////////////////////////////////////////////////////////
        void settingsPane_CommandsRequested(SettingsPane sender, SettingsPaneCommandsRequestedEventArgs args)
        {
            var aboutCmd = new SettingsCommand("About", "About", (x) => Launcher.LaunchUriAsync(new Uri("")));
            var supportCmd = new SettingsCommand("Support", "Support", (x) => Launcher.LaunchUriAsync(new Uri("")));
            var policyCmd = new SettingsCommand("PrivacyPolicy", "Privacy Policy", (x) => Launcher.LaunchUriAsync(new Uri("")));

            args.Request.ApplicationCommands.Add(aboutCmd);
            args.Request.ApplicationCommands.Add(supportCmd); 
            args.Request.ApplicationCommands.Add(policyCmd);
        }
Esempio n. 26
0
                void App_CommandsRequested(SettingsPane sender, SettingsPaneCommandsRequestedEventArgs args)
        {
            SettingsCommand command = new SettingsCommand("privacyPolicy", "Privacy policy", (handler) =>
            {
                Popup popup = BuildSettingsItem(new Views.Settings.PrivacyPolicy(),346);
                popup.IsOpen = true;
            });

            args.Request.ApplicationCommands.Add(command);
        }
Esempio n. 27
0
        private void OnCommandsRequested(SettingsPane sender, SettingsPaneCommandsRequestedEventArgs args)
        {
            SettingsCommand profileSettingsCommand = new SettingsCommand("profile-settings", "Profile Settings",
                                                          HandleProfileSettingsCommandRequest);
            args.Request.ApplicationCommands.Add(profileSettingsCommand);

            SettingsCommand privaciPolicyCommand = new SettingsCommand("privacy-policy", "Privacy Policy",
                                                          HandlePrivacyPolocySettingsCommand);
            args.Request.ApplicationCommands.Add(privaciPolicyCommand);
        }
Esempio n. 28
0
 private void ConfigurarSettings()
 {
     SettingsPane.GetForCurrentView().CommandsRequested +=
         (sender, args) =>
             {
                 
                 var generalCommand = new SettingsCommand("politicaDePrivacidade", "Política de privacidade", comando => Windows.System.Launcher.LaunchUriAsync(new Uri("https://github.com/giggio/multassociais-windowsapps/blob/master/README.md")));
                 args.Request.ApplicationCommands.Add(generalCommand);
             };
 }
Esempio n. 29
0
        void App_CommandsRequested(SettingsPane sender, SettingsPaneCommandsRequestedEventArgs args)
        {
            SettingsCommand command = new SettingsCommand("about", "About This App", (handler) =>
            {
                Popup popup = BuildSettingsItem(new AboutPage(), 646);
                popup.IsOpen = true;
            });

            args.Request.ApplicationCommands.Add(command);
        }
 void MainPage_CommandsRequested(SettingsPane sender, SettingsPaneCommandsRequestedEventArgs args)
 {
     args.Request.ApplicationCommands.Clear();
     SettingsCommand settingsCommand = new SettingsCommand("settings", "Settings", (x) =>
     {
         _settingsPopup = new Popup();
         _settingsPopup.Closed += _settingsPopup_Closed;
         Window.Current.Activated += Current_Activated;
         _settingsPopup.IsLightDismissEnabled = true;
         _settingsPopup.Width = _settingsWidth;
         _settingsPopup.Height = _windowBounds.Height;
         SettingsUserControl settingsPane = new SettingsUserControl();
         settingsPane.Width = _settingsWidth;
         settingsPane.Height = _windowBounds.Height;
         _settingsPopup.Child = settingsPane;
         _settingsPopup.SetValue(Canvas.LeftProperty, _windowBounds.Width - _settingsWidth);
         _settingsPopup.SetValue(Canvas.TopProperty, 0);
         _settingsPopup.IsOpen = true;
     });
     SettingsCommand privacyPolicyCommand = new SettingsCommand("privacyPolicy", "Privacy Policy", (x) =>
     {
         _settingsPopup = new Popup();
         _settingsPopup.Closed += _settingsPopup_Closed;
         Window.Current.Activated += Current_Activated;
         _settingsPopup.IsLightDismissEnabled = true;
         _settingsPopup.Width = _settingsWidth;
         _settingsPopup.Height = _windowBounds.Height;
         PrivacyPolicy settingsPane = new PrivacyPolicy();
         settingsPane.Width = _settingsWidth;
         settingsPane.Height = _windowBounds.Height;
         _settingsPopup.Child = settingsPane;
         _settingsPopup.SetValue(Canvas.LeftProperty, _windowBounds.Width - _settingsWidth);
         _settingsPopup.SetValue(Canvas.TopProperty, 0);
         _settingsPopup.IsOpen = true;
     });
     SettingsCommand registerCommand = new SettingsCommand("register", "Register", (x) =>
     {
         _settingsPopup = new Popup();
         _settingsPopup.Closed += _settingsPopup_Closed;
         Window.Current.Activated += Current_Activated;
         _settingsPopup.IsLightDismissEnabled = true;
         _settingsPopup.Width = _settingsWidth;
         _settingsPopup.Height = _windowBounds.Height;
         RegisterUser settingsPane = new RegisterUser();
         settingsPane.Width = _settingsWidth;
         settingsPane.Height = _windowBounds.Height;
         _settingsPopup.Child = settingsPane;
         _settingsPopup.SetValue(Canvas.LeftProperty, _windowBounds.Width - _settingsWidth);
         _settingsPopup.SetValue(Canvas.TopProperty, 0);
         _settingsPopup.IsOpen = true;
     });
     args.Request.ApplicationCommands.Add(settingsCommand);
     args.Request.ApplicationCommands.Add(registerCommand);
     args.Request.ApplicationCommands.Add(privacyPolicyCommand);
 }