void App_CommandsRequested(SettingsPane sender, SettingsPaneCommandsRequestedEventArgs args) { var privacy = new SettingsCommand( "privacyId", "Privacy", (handler) => { Popup popup = SettingsCharmExtensions.BuildSettingsItem(new PrivacyPanel(), 346); }); args.Request.ApplicationCommands.Add(privacy); }
private void BlankPage_CommandsRequested(SettingsPane sender, SettingsPaneCommandsRequestedEventArgs args) { // Note this is kept here for posterity but shouldn't be used // see the next sample of using the Windows.UI.Xaml.Controls.SettingsFlyout // in Windows 8.1 for the replacement if you were using this code example before. SettingsCommand cmd = new SettingsCommand("sample", "Sample Custom Setting", (x) => { // create a new instance of the flyout Callisto.Controls.SettingsFlyout settings = new Callisto.Controls.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); }); // note this is the new and preferred way in Windows 8.1 using // Windows.UI.Xaml.Controls.SettingsFlyout // This sample is kept here to show an example of this SettingsCommand cmd2 = new SettingsCommand("sample2", "Sample 2", (x) => { Windows.UI.Xaml.Controls.SettingsFlyout settings = new Windows.UI.Xaml.Controls.SettingsFlyout(); settings.Width = 500; settings.HeaderBackground = new SolidColorBrush(Colors.Orange); settings.HeaderForeground = new SolidColorBrush(Colors.Black); settings.Title = string.Format("{0} Custom 2", App.VisualElements.DisplayName); settings.IconSource = new BitmapImage(Windows.ApplicationModel.Package.Current.Logo); settings.Content = new SettingsContent(); settings.Show(); ObjectTracker.Track(settings); }); args.Request.ApplicationCommands.Add(cmd); args.Request.ApplicationCommands.Add(cmd2); }
private void onCommandsRequested(SettingsPane settingsPane, SettingsPaneCommandsRequestedEventArgs eventArgs) { UICommandInvokedHandler generalHandler = new UICommandInvokedHandler(onGeneralSettingsCommand); UICommandInvokedHandler connectionHandler = new UICommandInvokedHandler(onConnectionSettingsCommand); SettingsCommand generalCommand = new SettingsCommand("generalSettingsId", "General", generalHandler); eventArgs.Request.ApplicationCommands.Add(generalCommand); SettingsCommand connectionCommand = new SettingsCommand("connectionSettingsId", "Connection", connectionHandler); eventArgs.Request.ApplicationCommands.Add(connectionCommand); }
void OnCommandsRequested(SettingsPane sender, SettingsPaneCommandsRequestedEventArgs args) { var privacyPolicy = new SettingsCommand("privacyPolicy", "Polityka prywatności", (handler) => { var settings = new SettingsFlyout(); settings.Content = new PrivacyPolicy(); settings.HeaderBrush = new SolidColorBrush(Color.FromArgb(255, 10, 194, 255)); settings.Background = new SolidColorBrush(Color.FromArgb(255, 10, 194, 255)); settings.HeaderText = "Polityka prywatności"; settings.IsOpen = true; }); args.Request.ApplicationCommands.Add(privacyPolicy); }
/// <summary> /// Handler for the CommandsRequested event. Add custom SettingsCommands here. /// </summary> /// <param name="e">Event data that includes a vector of commands (ApplicationCommands)</param> void onCommandsRequested(SettingsPane settingsPane, SettingsPaneCommandsRequestedEventArgs e) { SettingsCommand defaultsCommand = new SettingsCommand("defaults", "Defaults", (handler) => { // SettingsFlyout1 is defined in "SettingsFlyout1.xaml" rootPage.NotifyUser("You opened the 'Defaults' SettingsFlyout.", NotifyType.StatusMessage); SettingsFlyout1 sf = new SettingsFlyout1(); sf.Show(); }); e.Request.ApplicationCommands.Add(defaultsCommand); }
private void settingsPane_CommandsRequested(SettingsPane sender, SettingsPaneCommandsRequestedEventArgs args) { UICommandInvokedHandler ConfigHandler = new UICommandInvokedHandler(onConfigCommand); UICommandInvokedHandler SignOutHandler = new UICommandInvokedHandler(onSignOutCommand); ResourceLoader loader = new ResourceLoader(); SettingsCommand configurationCommand = new SettingsCommand(loader.GetString("Settings_Configuration"), loader.GetString("Settings_Configuration"), ConfigHandler); SettingsCommand signOutCommand = new SettingsCommand(loader.GetString("Settings_SignOut"), loader.GetString("Settings_SignOut"), SignOutHandler); args.Request.ApplicationCommands.Add(configurationCommand); args.Request.ApplicationCommands.Add(signOutCommand); }
void currentPane_CommandsRequested(SettingsPane sender, SettingsPaneCommandsRequestedEventArgs args) { var appCommands = args.Request.ApplicationCommands; var command = new SettingsCommand("Privacy Policy", "Privacy Policy", async delegate { await Launcher.LaunchUriAsync( new Uri("http://trumpsoftware.heliohost.org/privacy.html")); }); appCommands.Add(command); }
// In most cases, it is a good idea to pause the game while the // settings pane is open. You can do this by adding the following code // to the top of the OnCommandsRequested method. This code is not // used by Reversi because the display settings are simple, and because // changing the settings results in animated changes to the game board // that would not be visible if the game were paused. //if (SettingsViewModel.GameViewModel != null && // SettingsViewModel.IsClockShowing) // SettingsViewModel.GameViewModel.Clock.Stop(); /// <summary> /// Provides app commands to populate the settings flyout. /// </summary> /// <param name="sender">The source of the command request.</param> /// <param name="args">Details about the command request</param> private void OnCommandsRequested(SettingsPane sender, SettingsPaneCommandsRequestedEventArgs args) { args.Request.ApplicationCommands.Add(new SettingsCommand("Display", "Display options", _ => (new DisplaySettings() { DataContext = SettingsViewModel }).Show())); args.Request.ApplicationCommands.Add(new SettingsCommand("NewGame", "New game options", _ => (new NewGameSettings() { DataContext = SettingsViewModel }).Show())); }
private void OnCommandsRequested(SettingsPane sender, SettingsPaneCommandsRequestedEventArgs args) { args.Request.ApplicationCommands.Add(new SettingsCommand("Help", "帮助", (handler) => ShowHelpFlyout())); // args.Request.ApplicationCommands.Add(new SettingsCommand("FeedBack", "反馈", (handler) => ShowFeedBackFlyout())); // args.Request.ApplicationCommands.Add(new SettingsCommand("Assess", "好评", (handler) => ShowAssessFlyout())); args.Request.ApplicationCommands.Add(new SettingsCommand("Privacy", "隐私", (handler) => ShowPrivacyFlyout())); args.Request.ApplicationCommands.Add(new SettingsCommand("About", "关于", (handler) => ShowAboutFlyout())); // args.Request.ApplicationCommands.Add(new SettingsCommand("More", "更多软件", (handler) => ShowAboutSettingFlyout())); }
private void OnCommandsRequested(SettingsPane sender, SettingsPaneCommandsRequestedEventArgs args) { args.Request.ApplicationCommands.Add(new SettingsCommand( "General Settings", "General", (handler) => ShowCustomSettingFlyoutGeneral())); args.Request.ApplicationCommands.Add(new SettingsCommand( "Server Settings", "Server", (handler) => ShowCustomSettingFlyoutMain())); args.Request.ApplicationCommands.Add(new SettingsCommand( "Streaming Settings", "Streaming", (handler) => ShowCustomSettingFlyoutStreaming())); args.Request.ApplicationCommands.Add(new SettingsCommand( "Privacy Policy", "Privacy statment (online)", (handler) => ShowPrivacyPolicy())); }
private void AppCommandsRequested(SettingsPane sender, SettingsPaneCommandsRequestedEventArgs args) { if (args.Request.ApplicationCommands.Count == 0) { var aboutCommand = new SettingsCommand("About", "About", new UICommandInvokedHandler(OnAboutSettingsCommand)); args.Request.ApplicationCommands.Add(aboutCommand); var privacyCommand = new SettingsCommand("Privacy", "Privacy", new UICommandInvokedHandler(OnPrivacySettingsCommand)); args.Request.ApplicationCommands.Add(privacyCommand); var helpCommand = new SettingsCommand("Help", "Help", new UICommandInvokedHandler(OnHelpSettingsCommand)); args.Request.ApplicationCommands.Add(helpCommand); } }
void settings_CommandsRequested(SettingsPane sender, SettingsPaneCommandsRequestedEventArgs args) { args.Request.ApplicationCommands.Add(new SettingsCommand("GitHubSource", "GitHub Source", async(e) => { await KanblogRuntime.OpenUriAsync(new Uri("https://github.com/mbrit/Kanblog")); })); args.Request.ApplicationCommands.Add(new SettingsCommand("About", "About", async(e) => { var version = Package.Current.Id.Version; var dialog = new MessageDialog(string.Format("A Kanban-style tool for blog story planning\r\nVersion {0}.{1}.{2}.{3}\r\nUses the MetroLog and sqlite-net libraries, and the SQLite database\r\nLicenced under the MIT license - https://github.com/mbrit/Kanblog", version.Major, version.Minor, version.Build, version.Revision), "Kanblog"); await dialog.ShowAsync(); })); }
/// <summary> /// This event is generated when the user opens the settings pane. During this event, append your /// SettingsCommand objects to the available ApplicationCommands vector to make them available to the /// SettingsPange UI. /// </summary> /// <param name="settingsPane">Instance that triggered the event.</param> /// <param name="eventArgs">Event data describing the conditions that led to the event.</param> void onCommandsRequested(SettingsPane settingsPane, SettingsPaneCommandsRequestedEventArgs eventArgs) { UICommandInvokedHandler handler = new UICommandInvokedHandler(onSettingsCommand); SettingsCommand aboutCommand = new SettingsCommand("AboutAppId", "Rakenduse kirjeldus", handler); eventArgs.Request.ApplicationCommands.Add(aboutCommand); SettingsCommand privacyCommand = new SettingsCommand("PrivacyPolicyId", "Privaatsuspoliitika", handler); eventArgs.Request.ApplicationCommands.Add(privacyCommand); SettingsCommand termsofuseCommand = new SettingsCommand("TermsOfUseId", "Kasutajatingimused", handler); eventArgs.Request.ApplicationCommands.Add(termsofuseCommand); }
private void App_CommandsRequested(SettingsPane sender, SettingsPaneCommandsRequestedEventArgs args) { var about = new SettingsCommand("about", "About", (handler) => { SettingsFlyout settings = new SettingsFlyout(); settings.Content = new AboutUserControl(); //settings.Background = new SolidColorBrush(_background); //settings.HeaderBackground = new SolidColorBrush(_background); //settings.Title = "About"; settings.Show(); }); args.Request.ApplicationCommands.Add(about); }
void AppCommandsRequested(SettingsPane sender, SettingsPaneCommandsRequestedEventArgs args) { SettingsCommand cmd = new SettingsCommand("account", "Account", (x) => { _settingsPopup = new Popup(); _settingsPopup.Closed += OnPopupClosed; Window.Current.Activated += OnWindowActivated; _settingsPopup.IsLightDismissEnabled = true; _settingsPopup.Width = _settingsWidth; _settingsPopup.Height = _windowBounds.Height; AccFly mypane = new AccFly(); 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); var about = new SettingsCommand("about", "About the App", OpenAbout); args.Request.ApplicationCommands.Add(about); var features = new SettingsCommand("features", "Features of the App", OpenFeatures); args.Request.ApplicationCommands.Add(features); // Privacy settings command. cmd = new SettingsCommand("privacy", "Privacy", (x) => { _settingsPopup = new Popup(); _settingsPopup.Closed += OnPopupClosed; Window.Current.Activated += OnWindowActivated; _settingsPopup.IsLightDismissEnabled = true; _settingsPopup.Width = _settingsWidth; _settingsPopup.Height = _windowBounds.Height; fly mypane = new fly(); 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); }
void App_CommandsRequested(SettingsPane sender, SettingsPaneCommandsRequestedEventArgs args) { UICommandInvokedHandler handler = new UICommandInvokedHandler(onSettingsCommand); SettingsCommand generalCommand = new SettingsCommand("generalSettings", "General", handler); args.Request.ApplicationCommands.Add(generalCommand); SettingsCommand helpCommand = new SettingsCommand("helpPage", "Help", handler); args.Request.ApplicationCommands.Add(helpCommand); SettingsCommand defaultCommand = new SettingsCommand("defaultPage", "Default", handler); args.Request.ApplicationCommands.Add(defaultCommand); }
/// <summary> /// Handler for the CommandsRequested event. Add custom SettingsCommands here. /// </summary> /// <param name="settingsPane">The settings pane.</param> /// <param name="e">Event data that includes a vector of commands (ApplicationCommands)</param> private void OnCommandsRequested(SettingsPane settingsPane, SettingsPaneCommandsRequestedEventArgs e) { if (!_forumEntity.IsBookmarks) { return; } var bookmarksCommand = new SettingsCommand("bookmarkSettings", "Bookmarks", handler => { var up = new BookmarkSettingsFlyout(); up.Show(); }); e.Request.ApplicationCommands.Add(bookmarksCommand); }
void App_CommandsRequested(SettingsPane sender, SettingsPaneCommandsRequestedEventArgs args) { var optionsCharmCmd = new SettingsCommand("options", "Options", handler => { var flyout = Flyouts.Build("Options", new Settings()); flyout.Show(); }); var privacyPolicyCharmCmd = new SettingsCommand("privacy", "Privacy policy", handler => { var flyout = Flyouts.Build("Privacy policy", new PrivacyPolicy()); flyout.Show(); }); var appCommands = args.Request.ApplicationCommands; appCommands.Add(optionsCharmCmd); appCommands.Add(privacyPolicyCharmCmd); }
void settings_CommandsRequested(SettingsPane sender, SettingsPaneCommandsRequestedEventArgs args) { args.Request.ApplicationCommands.Add(new SettingsCommand("PrivacyStatement", "Privacy statement", async(e) => { await SettingsInteractionHelper.ShowPrivacyStatementAsync(); })); args.Request.ApplicationCommands.Add(new SettingsCommand("MySettings", "My Settings", (e) => { var flyout = new MySettingsFlyout(new MySettingsPane()); flyout.Show(); })); args.Request.ApplicationCommands.Add(new SettingsCommand("Help", "Help", (e) => { ShowHelp(); })); }
private void settingsPane_CommandsRequested(SettingsPane sender, SettingsPaneCommandsRequestedEventArgs args) { var ConfigHandler = new UICommandInvokedHandler(onConfigCommand); var LogoutHandler = new UICommandInvokedHandler(onLogoutCommand); var loader = new ResourceLoader(); var configurationCommand = new SettingsCommand(loader.GetString("Settings"), loader.GetString("Settings"), ConfigHandler); args.Request.ApplicationCommands.Add(configurationCommand); if (!string.IsNullOrEmpty(ConnectedService.LoggedInUser)) { var logoutCommand = new SettingsCommand(loader.GetString("Logout"), loader.GetString("Logout"), onLogoutCommand); args.Request.ApplicationCommands.Add(logoutCommand); } }
void OnCommandsRequested(SettingsPane sender, SettingsPaneCommandsRequestedEventArgs args) { var privacyPolicy = new SettingsCommand("privacypolicy", "Acerca de...", (handler) => { var settings = new SettingsFlyout(); settings.Content = new PrivatePolicyUserControl(); settings.HeaderBrush = new SolidColorBrush(Colors.DarkSlateBlue); settings.ContentBackgroundBrush = new SolidColorBrush(Colors.Snow); settings.ContentForegroundBrush = new SolidColorBrush(Colors.Black); settings.HeaderText = "Acerca de..."; settings.IsOpen = true; }); args.Request.ApplicationCommands.Add(privacyPolicy); }
/// <summary> /// Called when the Settings charm is invoked, this handler populates the Settings charm with the charm items returned by the GetSettingsCommands function. /// </summary> /// <param name="sender">The sender.</param> /// <param name="args">The <see cref="SettingsPaneCommandsRequestedEventArgs"/> instance containing the event data.</param> private void OnCommandsRequested(SettingsPane sender, SettingsPaneCommandsRequestedEventArgs args) { if (args == null || args.Request == null || args.Request.ApplicationCommands == null) { return; } var applicationCommands = args.Request.ApplicationCommands; var settingsCommands = GetSettingsCommands(); foreach (var settingsCommand in settingsCommands) { applicationCommands.Add(settingsCommand); } }
void OnCommandsRequested(SettingsPane sender, SettingsPaneCommandsRequestedEventArgs args) { // Add an About command var about = new SettingsCommand("about", "About", (handler) => { var settings = new SettingsFlyout(); settings.Content = new AboutUserControl(); settings.HeaderBrush = new SolidColorBrush(_background); settings.Background = new SolidColorBrush(_background); settings.HeaderText = "About"; settings.IsOpen = true; }); args.Request.ApplicationCommands.Add(about); }
void LayoutAwarePage_CommandsRequested(SettingsPane sender, SettingsPaneCommandsRequestedEventArgs args) { string label = "Privacy Policy"; if (!args.Request.ApplicationCommands.Any(c => c.Id == label)) { SettingsCommand cmd = new SettingsCommand(label, label, async(x) => { await Launcher.LaunchUriAsync(new Uri("http://codecube.net/khanacademy/privacy/")); }); args.Request.ApplicationCommands.Add(cmd); } }
void App_CommandsRequested(SettingsPane sender, SettingsPaneCommandsRequestedEventArgs args) { var loginCmd = new SettingsCommand("login", "Login", new Windows.UI.Popups.UICommandInvokedHandler(x => { ShowLoginScreen(); })); var signUpCmd = new SettingsCommand("sign up", "Sign Up", new Windows.UI.Popups.UICommandInvokedHandler(x => { ShowSignUpScreen(); })); args.Request.ApplicationCommands.Clear(); args.Request.ApplicationCommands.Add(loginCmd); args.Request.ApplicationCommands.Add(signUpCmd); }
/// <summary> /// Called when the Settings charm is invoked, this handler populates the Settings charm with the charm items returned by the GetSettingsCharmActionItems function. /// </summary> /// <param name="sender">The sender.</param> /// <param name="args">The <see cref="SettingsPaneCommandsRequestedEventArgs"/> instance containing the event data.</param> private void OnCommandsRequested(SettingsPane sender, SettingsPaneCommandsRequestedEventArgs args) { if (args == null || args.Request == null || args.Request.ApplicationCommands == null) { return; } var applicationCommands = args.Request.ApplicationCommands; var settingsCharmActionItems = GetSettingsCharmActionItems(); foreach (var item in settingsCharmActionItems) { var settingsCommand = new SettingsCommand(item.Id, item.Title, (o) => item.Action.Invoke()); applicationCommands.Add(settingsCommand); } }
/// <summary> /// This event is generated when the user opens the settings pane. During this event, append your /// SettingsCommand objects to the available ApplicationCommands vector to make them available to the /// SettingsPange UI. /// </summary> /// <param name="settingsPane">Instance that triggered the event.</param> /// <param name="eventArgs">Event data describing the conditions that led to the event.</param> void onCommandsRequested(SettingsPane settingsPane, SettingsPaneCommandsRequestedEventArgs eventArgs) { UICommandInvokedHandler handler = new UICommandInvokedHandler(onSettingsCommand); SettingsCommand settingsCommand = new SettingsCommand("SettingsId", "BGG Account", handler); eventArgs.Request.ApplicationCommands.Add(settingsCommand); UICommandInvokedHandler abouthandler = new UICommandInvokedHandler(onAboutCommand); SettingsCommand aboutCommand = new SettingsCommand("AboutId", "About", abouthandler); eventArgs.Request.ApplicationCommands.Add(aboutCommand); SettingsCommand privacyPolicyCommand = new SettingsCommand("privacyPolicy", "Privacy Policy", (uiCommand) => { LaunchPrivacyPolicyUrl(); }); eventArgs.Request.ApplicationCommands.Add(privacyPolicyCommand); }
void App_CommandsRequested(SettingsPane sender, SettingsPaneCommandsRequestedEventArgs args) { UICommandInvokedHandler handler = new UICommandInvokedHandler(onSettingsCommand); //SettingsCommand aboutCommand = new SettingsCommand("AU", "About Us", handler); //args.Request.ApplicationCommands.Add(aboutCommand); //SettingsCommand contactCommand = new SettingsCommand("CU", "Contact Us", handler); //args.Request.ApplicationCommands.Add(contactCommand); //SettingsCommand privacyCommand = new SettingsCommand("PP", "Privacy Policy", handler); //args.Request.ApplicationCommands.Add(privacyCommand); //SettingsCommand termsCommand = new SettingsCommand("TC", "Terms and Conditions", handler); //args.Request.ApplicationCommands.Add(termsCommand); }
private void OnCommandsRequested(SettingsPane sender, SettingsPaneCommandsRequestedEventArgs args) { args.Request.ApplicationCommands.Add(new SettingsCommand( "settings", "Farbe + LiveTile", (handler) => { Settings SettingsFlyout = new Settings(); SettingsFlyout.Show(); } )); args.Request.ApplicationCommands.Add(new SettingsCommand( "contact", "Support + Vorschlag einreichen", (handler) => suppport())); args.Request.ApplicationCommands.Add(new SettingsCommand( "semester", "Semester auswählen", (handler) => semester())); args.Request.ApplicationCommands.Add(new SettingsCommand( "windowsphone", "Windows Phone App", (handler) => windowsphone())); }
private void DisplayAbout(SettingsPane sender, SettingsPaneCommandsRequestedEventArgs args) { // Add a Preferences command var aboutCommand = new SettingsCommand("about", "About", (handler) => { var about = new Callisto.Controls.SettingsFlyout(); about.Content = new aboutUserControl(); about.HeaderBrush = new SolidColorBrush(_background); about.Background = new SolidColorBrush(_background); about.HeaderText = "About"; about.IsOpen = true; }); args.Request.ApplicationCommands.Add(aboutCommand); }
private void OnCommandsRequested(SettingsPane sender, SettingsPaneCommandsRequestedEventArgs args) { var setting = new SettingsCommand("MySetting", "MySetting", handler => new MySettingsFlyout().Show()); args.Request.ApplicationCommands.Add(setting); }