The original version of Silverlight is the same as that of flash and can only be run in the browser. The host is in the browser. After Silverlight 3, the function that can run without the browser is added, programs can be downloaded to the local offline for running, and the Silverlight program can be opened through shortcuts. This feature is very "cool" and is very novel and contemporary.
It is also very easy to run without a browser (this is also a common feature of Microsoft products. Many people also say that Microsoft's things are not flexible. In fact, this is a proof of technical strength, and the scalability is very good .)
Right-click the Silverlight project and choose Properties to open the Project Properties window. For example, select the check box in the red box,Note that the xap cache conflicts with the running outside the browser.
After the parameters are configured, The appmanifest. xml file in the project folder records the configuration S.
Use the code to prompt you to install the local application
Private void installapp () {Switch (application. Current. installstate) {Case installstate. Installed: MessageBox. Show (" |? Which of the following statements have been executed? 2 installation degree. Break "); break; Case installstate. installfailed: MessageBox. Show (" |? Cheng xuanyuan shao'an 2 installation ° loss § defeat U ,? Please? ? Try ?. Break "); break; Case installstate. Installing: MessageBox. Show (" |? Cheng xiangzheng Zheng y installs ° in úan 2, D... -"); Break; Case installstate. notinstalled: application. Current. Install (); // Install 2? Ben? Location? Break ;}}
Check for updates
Application APP = app. Current; Public SC _app_checkupdate () {initializecomponent (); addevent () ;}// '¨? Line? Application | use? In the descending order, what is new? Things? Piece t void addevent () {app. checkanddownloadupdatecompleted + = new checkanddownloadupdatecompletedeventhandler (current_checkanddownloadupdatecompleted); // start? Change U new? App. checkanddownloadupdateasync ();} // What is the new version? After I complete my tasks? File t void current_checkanddownloadupdatecompleted (Object sender, checkanddownloadupdatecompletedeventargs e) {If (E. updateavailable) {MessageBox. Show ("publish current? New? Version? Ben?? Silverlight application | use? Process sequence "+ ",? Please?? New? Qi? Use? You?? Application | use? Explain in the descending order !? ");} Else if (E. Error! = NULL & E. error is platformnotsupportedexception) {MessageBox. Show ("Publish failed? New? Version? Ben? Silverlight application | use? In descending order ,? "+"? Yes? No? Nengu Yun? Row D's in úur? Silverlight version? Ben? Medium D ,? Please? Access? Q: What is the new version of the master route page 3 in the descending order? ");} Else {MessageBox. Show (" no? D New? Version? Ben? Application | use? In the descending order of Cheng shujié, I want a to be updated ?!? ");}}