Windows 8 series-ApplicationSettings-Essays

Source: Internet
Author: User
// Add an event to the settings panel
SettingsPane. GetForCurrentView (). CommandsRequested + = MainPage_CommandsRequested;
// Triggered upon clicking, add a void MainPage_CommandsRequested (SettingsPane sender, javasargs) {// define the Execution Processing Event UICommandInvokedHandler handle = new UICommandInvokedHandler (onSettingsCommand ); // define the SET command item SettingsCommand generalCommand = new SettingsCommand ("generalSettings", "general", handle); // Add the command item to the set args. request. applicationCommands. add (generalCommand );}
// Execute command item event void onSettingsCommand (IUICommand command) {SettingsCommand settingsCommand = (SettingsCommand) command; showBlock. Text = settingsCommand. Label ;}
// Define the popup form private Popup settingsPopup; void onSettingsCommand1 (IUICommand command) {settingsPopup = new Popup ();
// SettingsPopup when popup is disabled. closed + = settingsPopup_Closed; Window. current. activated + = Current_Activated; settingsPopup. isLightDismissEnabled = true; settingsPopup. width = settingsWidth; settingsPopup. height = windowBounds. height; settingsPopup. childTransitions = new TransitionCollection (); settingsPopup. childTransitions. add (new PaneThemeTransition () {Edge = (SettingsPane. edge = SettingsEdgeLocatio N. Right )? EdgeTransitionLocation. right: EdgeTransitionLocation. left}); // Add the user xmal to Popup. SettingsFlyout mypane = new SettingsFlyout (); mypane. width = settingsWidth; mypane. height = windowBounds. height; settingsPopup. child = mypane; settingsPopup. setValue (Canvas. leftProperty, SettingsPane. edge = SettingsEdgeLocation. right? (WindowBounds. Width-settingsWidth): 0); settingsPopup. SetValue (Canvas. TopProperty, 0); settingsPopup. IsOpen = true ;}
void settingsPopup_Closed(object sender, object e)        {            Window.Current.Activated -= Current_Activated;        }
 void Current_Activated(object sender, Windows.UI.Core.WindowActivatedEventArgs e)        {            //throw new NotImplementedException();            if (e.WindowActivationState == Windows.UI.Core.CoreWindowActivationState.Deactivated)            {                settingsPopup.IsOpen = false;            }        }
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.