您是否可以强制Silverlight仅运行浏览器外?

Jon*_*len 5 silverlight silverlight-oob

您是否可以强制Silverlight仅运行浏览器外?

编辑:我问的原因是因为很多Silverlight的功能只适用于OOB.如果我的应用程序依赖于此,我需要要求Silverlight应用程序以该模式运行或选择其他内容.

Ant*_*nes 9

如何在你Application_Startup的App.Xaml.cs中使用它: -

private void Application_Startup(object sender, StartupEventArgs e)
{

     if (IsRunningOutOfBrowser)
     {
          this.RootVisual = new MainPage();
     }
     else
     {
          this.RootVisual = new PleaseRunOOB():
     }
}
Run Code Online (Sandbox Code Playgroud)

现在创建一个非常简单的UserControl,调用它PleaseRunOOB来向用户呈现安装和/或运行应用程序的OOB版本的neeed.


nat*_*lez 4

http://blogs.microsoft.co.il/blogs/alex_golesh/archive/2010/03/15/silverlight-4-quick-tip-out-of-browser-improvements.aspx

\n\n

新的 OOB 模型存在的附加功能是能够不从网页安装应用程序(就像版本 3 中的那样),而是从命令行(有可用的 XAP 文件)安装应用程序。Silverlight 4 OOB 启动器具有新的命令行参数,可以在 \xe2\x80\x9cemulation 模式\xe2\x80\x9d \xe2\x80\x93 中安装、卸载和执行应用程序,而无需安装它。

\n\n

例如。要在桌面上安装应用程序,请使用以下命令:

\n\n
"%ProgramFiles(x86)%\\Microsoft Silverlight\\sllauncher.exe" /overwrite /install:"X:\\PACKAGE_LOCATION\\SL4Features.Web\\ClientBin\\APPLICATION.xap"\n/origin:http://ORIGINAL_LOCATION/ORIGINAL_HOSTING_PAGE /shortcut:desktop\n
Run Code Online (Sandbox Code Playgroud)\n\n

要卸载它,请使用以下命令:

\n\n
"%ProgramFiles(x86)%\\Microsoft Silverlight\\sllauncher.exe" /overwrite /uninstall:"X:\\PACKAGE_LOCATION\\APPLICATION.xap"\n/origin:http://ORIGINAL_LOCATION/ORIGINAL_HOSTING_PAGE /shortcut:desktop\n
Run Code Online (Sandbox Code Playgroud)\n\n

要运行应用程序而不安装它(在模拟模式下),请使用以下命令:

\n\n
"%ProgramFiles(x86)%\\Microsoft Silverlight\\sllauncher.exe" /overwrite /emulate:"X:\\PACKAGE_LOCATION\\APPLICATION.xap" /origin:http://ORIGINAL_LOCATION/\n
Run Code Online (Sandbox Code Playgroud)\n