Silverlight Study Notes (2)-install Silverlight locally

Source: Internet
Author: User

Outofbrowser. XAML

<Button X: Name = "button" Click = "button_click" width = 100 Height = 30> </button>

 

Outofbrowser. XAML. CS

Public outofbrowser ()

{

Initializecomponent ();

This. Loaded + = new routedeventhandler (outofbrowser_loaded );

}

 

Void outofbrowser_loaded (Object sender, routedeventargs E)

{

Initbutton ();

App. Current. installstatechanged + = new eventhandler (current_installstatechanged );

}

 

Void current_installstatechanged (Object sender, eventargs E)

{

Initbutton ();

}

 

Private void button_click (Object sender, routedeventargs E)

{

If (! App. Current. isrunningoutofbrowser & App. Current. installstate = installstate. notinstalled)

App. Current. Install ();

Else

MessageBox. Show ("right-click to uninstall! ");

}

 

 

Private void initbutton ()

{

If (App. Current. isrunningoutofbrowser)

Button. content = "uninstall ";

Else

Button. content = "Install ";

}

Right-click Properties in solution, select Open, select Silverlight from the Open menu, and select allow applications to run outside the browser.ProgramClick the Settings button outside the browser. In the displayed window, set the title, height, and width of the window to be displayed after installation, as well as the shortcut name and download instructions. Save the settings, an outofbrowsersettings is generated in properties. XML file, which displays the information we Just configured.

Then run the command to install it!

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.