tonwei139 发表于 2015-5-21 08:37:47

win8 app 设置面板 SettingsPane

  在win8 中调用系统的设置面板 ,然后将该设置面板用到当前应用程序中
  SettingsPane
  


              SettingsPane settingsPane;
      
        public MainPage()
      {
            this.InitializeComponent();
            this.settingsPane = SettingsPane.GetForCurrentView();
            this.settingsPane.CommandsRequested += settingsPane_CommandsRequested;
      }
      void settingsPane_CommandsRequested(SettingsPane sender, SettingsPaneCommandsRequestedEventArgs args)
      {
            SettingsCommand accountSettingsCommand = new SettingsCommand("AccountCommand", "账号设置", onAccountCommand);
            if (!args.Request.ApplicationCommands.Contains(accountSettingsCommand))
            {
                args.Request.ApplicationCommands.Add(accountSettingsCommand);
            }
            SettingsCommand suggestionSettingsCommand = new SettingsCommand("SuggestionCommand", "意见反馈", onSuggestionCommand);
            if (!args.Request.ApplicationCommands.Contains(suggestionSettingsCommand))
            {
                args.Request.ApplicationCommands.Add(suggestionSettingsCommand);
            }
      }
      private void onSuggestionCommand(IUICommand command)
      {
            base.Frame.Navigate(typeof(SettingsPage));
      }
      private void onAccountCommand(IUICommand command)
      {
            base.Frame.Navigate(typeof(SuggestionPage));
      }
页: [1]
查看完整版本: win8 app 设置面板 SettingsPane