private void Setting_Tapped(object sender, TappedRoutedEventArgs e)
 {
     topAppBar.IsOpen = false;
     bottomAppBar.IsOpen = false;
     MyControl.PreferenceSettingControl control = new MyControl.PreferenceSettingControl();
     control.Show();
 }
예제 #2
0
        private void InitSettingPane()
        {
            Windows.UI.ApplicationSettings.SettingsCommand cmd1 = new Windows.UI.ApplicationSettings.SettingsCommand("1", "帐户", c =>
            {
                Frame.Navigate(typeof(AccountView));
            });
            Windows.UI.ApplicationSettings.SettingsCommand cmd2 = new Windows.UI.ApplicationSettings.SettingsCommand("2", "选项", c =>
            {
                MyControl.PreferenceSettingControl control = new MyControl.PreferenceSettingControl();
                control.Show();
            });
            Windows.UI.ApplicationSettings.SettingsCommand cmd3 = new Windows.UI.ApplicationSettings.SettingsCommand("3", "关于", c =>
            {
                MyControl.PreferenceAboutControl control = new MyControl.PreferenceAboutControl();
                control.Show();
            });
            Windows.UI.ApplicationSettings.SettingsCommand cmd4 = new Windows.UI.ApplicationSettings.SettingsCommand("4", "隐私策略", c =>
            {
                try
                {
                    Uri uri = new Uri("http://thankcreate.github.com/Care/privacy.html");
                    Windows.System.Launcher.LaunchUriAsync(uri);
                }
                catch (System.Exception ex)
                {

                }
            });
            // 命令是在CommandsRequested事件中添加的
            Windows.UI.ApplicationSettings.SettingsPane.GetForCurrentView().CommandsRequested += (sp, arg) =>
            {
                arg.Request.ApplicationCommands.Add(cmd1);
                arg.Request.ApplicationCommands.Add(cmd2);
                arg.Request.ApplicationCommands.Add(cmd3);
                arg.Request.ApplicationCommands.Add(cmd4);
            };
        }