BitmapImage不包含AutoPlay的定义

时间:2017-01-27 04:27:52

标签: uwp

我正在尝试在我的UWP应用中播放GIF动画,但是按照说明here

我仍然收到错误。我有Visual Studio 2015更新3.

我错过了参考资料吗?

enter image description here enter image description here

  

严重级代码描述项目文件行抑制状态   错误CS1061'bitmapImage'不包含的定义   '自动播放'并且没有扩展方法'自动播放'接受第一个   可以找到“BitmapImage”类型的参数(你是否错过了使用   指令或程序集引用?)

1 个答案:

答案 0 :(得分:1)

  

如何检查它是否存在?

您可以使用ApiInformation类中的方法在运行时检查当前操作系统是否支持类,方法,属性,事件或API契约。

  

位于Windows.Foundation.Metadata命名空间中的ApiInformation类包含几个用于查询API的静态方法(如IsApiContractPresent,IsEventPresent和IsMethodPresent)。

请阅读Dynamically detecting features with API contracts (10 by 10)了解详情。

  

这是适用于周年纪念日更新的Windows SDK吗?

是。您可以在此处下载:https://developer.microsoft.com/en-us/windows/downloads/windows-10-sdk

同时,您需要将项目重新定位到“14393”。 enter image description here