微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

Silverlight 8.1 新功能

Silverlight 8.1,这是个有点奇葩的版本号。

Silverlight 在Web上到5.0就没有继续更新了,在WP上一直做为界面输出,然而WP7.X时代没有公开它是Silverlight 7,在WP8.0也没有公开它是Silverlight 8.0,这到了WP8.1就直接叫他是Silverlight 8.1了,让很多开发者有点晕。

Silverlight 8.1 在WP上指的是WP8.1的一种项目模板,为了完全向下兼容WP8.0而存在。

但也有部分行为需要重新定义,包括后退键的处理。具体如下:

按后退键时退出应用。@H_404_16@

Silverlight 8.1 and Windows Phone 8 apps are terminated when the user uses the Back button to navigate backward past the first page of the app. This is different than the behavior of Windows Phone Store apps,which are paused when the user backs out of them. You can force your app to use the behavior of Windows Phone Store apps by setting PauseOnBack,which causes your app to be suspended when the user navigates backward past the first page of the app.


恢复而不是创建一个新的实例@H_404_16@

On Windows Phone 8,the default behavior when the user launches an app from the Apps list or its primary tile is for a new instance of the app to be launched,replacing any existing instance of the app. Developers Could override this behavior by modifying the app manifest,described in Enabling Fast Resume in the app manifest file. A Silverlight 8.1 app is always resumed when launched,instead of replacing any running instance. This behavior matches the behavior of Windows Phone Store apps. However,Silverlight 8.1 and Windows Phone 8 apps are terminated when the user uses the Back button to navigate backward past the first page of the app. After an app is terminated this way,any launch of the app will result in a new instance being created.

不支持持续的后台执行@H_404_16@

Windows Phone 8 apps can continue to run in the background after the user navigates away from the app under certain conditions. This feature is not available for Silverlight 8.1 apps. If you need this feature,you should continue to use a Windows Phone 8 app. For more @R_293_4045@ion,see Running location-tracking apps in the background for Windows Phone 8.


后台代理可用的cpu时间片更少@H_404_16@

For a managed Windows Phone 8 ScheduledTaskAgent to be able to access Silverlight 8.1 features,it runs on the modern execution stack,which is converged with Windows. This uses a different cpu quota mechanism than Windows Phone 8. In some cases,a Silverlight 8.1 background agent might find that it gets less cpu time than it did prevIoUsly. If that happens,the app may choose to call RequestAccessAsync()()()(). This will increase the cpu quota given to the agent.


不支持AudioPlayerAgentAudioStreamingAgent

不支持 WalletAgent

不支持in-process后台任务

不支持本地化的磁贴更新(MNPS)

不能使用托管的Windows Runtime Componnet

需要在WMAppManifest.xml中声明DefaultTask

不能在WMAppManifest.xml中声明支持的分辨率

App Bar的行为在不同设备上表现不同

不能使用XNA

使用Windows.system.memoryManager查看内存使用

不要在主线程中调用WaitForPendingFinalizers()

SL8.1在前台主线程使用STA,而WP8.0使用MTA


Panorama的改变

In Windows Phone 8,Panorama does not call Measure(Size) for collapsed items. This has the consequence that items initially added as Collapsed are not displayed when their visibility is set to Visible until some other event triggers a call to MeasureOverride(Size). This is not the case in Silverlight 8.1

In Silverlight 8.1,Panorama handles PanoramaItem objects uniformly,whether they were explicitly added or generated through databinding. The SelectedItem property will return the associated data item. Also,the SelectionChanged event is Now raised for databound PanoramaItem objects. In Windows Phone 8,it is not.

Web requests的改变

  • In Windows Phone 8,HTTP requests using the TRACE verb are blocked. This verb is allowed in Silverlight 8.1.

  • In Windows Phone 8,the BeginGetResponse(AsyncCallback,Object) callback is invoked only when the response body is received rather than when the response headers arereceived,even when AllowReadStreamBuffering is set to false. This is fixed in Silverlight 8.1.

  • In Windows Phone 8,when a protocol error occurs on a web request,the resulting WebException message always indicates that the error is "Not Found". In Silverlight 8.1,the error message indicates which protocol error occurred.

  • In Windows Phone 8,http-only cookies are stripped out of web responses before passing the CookieContainer back to the app. This is not done in Silverlight 8.1.

  • In Windows Phone 8,HttpWebRequest is limited to a fixed 5 automatic redirects. This limitation has been removed.

  • In Windows Phone 8,HttpWebRequest rewrites a request as GET before resending it if a 307 Temporary Redirect response status code is received. This behavior is incorrect according to RFC 2616 and has been fixed in Silverlight 8.1.

  • If an HttpWebRequest is aborted before EndGetResponse(IAsyncResult) is called,then calling EndGetResponse(IAsyncResult) would throw an exception even if a response had been received. In Windows Phone 8,in this scenario HaveResponse returns true even though it is impossible for an app to retrieve the response

Web browser 的改变

The HTML5 project template has been modified for Silverlight 8.1. The included CSS file (phone.css) contains deFinition for width,which was set to values that would not scale well with newly supported device resolutions. In Silverlight 8.1,the value "device-width" has been added and will return correct values based on device size and resolutions.

In the Windows Phone 8 WebBrowser control,the default value of IsScriptEnabled is false,which caused frustration among developers because it’s not obvIoUs that it needs to be set to true for the control to work correctly. In Silverlight 8.1 the tools have been updated to set that value to true by default at design time.

In Silverlight 8.1,the User Agent string used by the WebBrowser control has been updated to include the string “Webbrowser/8.1” to enable web sites to identify clients using the control. 


CLR的改变

XDocument.Load只能加载.appx包中的内容

Uri支持ms-app语法

Sort()使用introspective sort取代快排。

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。

相关推荐