當前位置: 首頁>>代碼示例>>C#>>正文


C# ApplicationSettings.SettingsCommand類代碼示例

本文整理匯總了C#中Windows.UI.ApplicationSettings.SettingsCommand的典型用法代碼示例。如果您正苦於以下問題:C# SettingsCommand類的具體用法?C# SettingsCommand怎麽用?C# SettingsCommand使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


SettingsCommand類屬於Windows.UI.ApplicationSettings命名空間,在下文中一共展示了SettingsCommand類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: settingsPane_CommandsRequested

        ///////////////////////////////////////////////////////////////////////////////////
        // 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);
        }
開發者ID:AntonioJorgeFlorindo,項目名稱:StarterKits,代碼行數:28,代碼來源:MainPage.xaml.cs

示例2: CommandsRequested

        void CommandsRequested(SettingsPane sender, SettingsPaneCommandsRequestedEventArgs args)
        {
            UICommandInvokedHandler handler = new UICommandInvokedHandler(onSettingsCommand);

            SettingsCommand policyCommand = new SettingsCommand("policyCommand", "Privacy Policy", handler);
            args.Request.ApplicationCommands.Add(policyCommand);
        }
開發者ID:kiewic,項目名稱:WindowsStoreApps,代碼行數:7,代碼來源:LogInPage.xaml.cs

示例3: BlankPage_CommandsRequested

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);
}
開發者ID:BeyondVincent,項目名稱:WindowsStoreAppCode,代碼行數:28,代碼來源:MainPage.xaml.cs

示例4: CommandsRequested

 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); }
開發者ID:Razmal,項目名稱:libmpeg2-winrt,代碼行數:7,代碼來源:App.xaml.cs

示例5: BlankPage_CommandsRequested

        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);
        }
開發者ID:shiftkey,項目名稱:callisto,代碼行數:25,代碼來源:SettingsSample.xaml.cs

示例6: OnCommandsRequested

        // <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);
                }
            }
        }
開發者ID:stevenh77,項目名稱:ItineraryHunter-Win8,代碼行數:27,代碼來源:SettingsCharmService.cs

示例7: BlankPage_CommandsRequested

        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);
        }
開發者ID:rgmills,項目名稱:callisto,代碼行數:32,代碼來源:SettingsSample.xaml.cs

示例8: GroupedItemsPage_CommandsRequested

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

        }
開發者ID:harunpehlivan,項目名稱:LiveSDK-for-Windows,代碼行數:27,代碼來源:GroupedItemsPage.xaml.cs

示例9: OnCommandsRequested

 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);
 }
開發者ID:rousse101,項目名稱:WritePadSDK,代碼行數:7,代碼來源:SettingsUI.cs

示例10: SettingsCommandRequested

        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);
        }
開發者ID:robUx4,項目名稱:vlc-winrt,代碼行數:26,代碼來源:ShellContent.xaml.cs

示例11: SetCommandsRequested

        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);
        }
開發者ID:mbin,項目名稱:Win81App,代碼行數:29,代碼來源:MainPage.xaml.cs

示例12: ConfigureSettings

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

        }
開發者ID:TheAngryByrd,項目名稱:MetroPass,代碼行數:31,代碼來源:App.xaml.cs

示例13: OnWindowCreated

        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);
        }
開發者ID:sinhpham,項目名稱:PhotoGlider,代碼行數:25,代碼來源:App.xaml.cs

示例14: SettingsCommandsRequested

        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);
        }
開發者ID:henrybond158,項目名稱:RadioRivendell,代碼行數:8,代碼來源:MainPage.xaml.cs

示例15: MainPage_CommandsRequested

 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);
 }
開發者ID:ClarkChen633,項目名稱:MyCSharp,代碼行數:8,代碼來源:MainPage.xaml.cs


注:本文中的Windows.UI.ApplicationSettings.SettingsCommand類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。