当 TargetDeviceFamily 是 UNIVERSAL 但不是 DESKTOP 时,BitmapImage 将在 UWP 应用程序中播放 GIF 动画?

BitmapImage will play GIF animation in an UWP app when TargetDeviceFamily is UNIVERSAL but not DESKTOP?

刚刚花了几个小时试图理解为什么我的 GIF 停止播放,直到我意识到我已经将 Package.appxmanifest 中的目标从

更改了
<TargetDeviceFamily Name="Windows.Universal" MinVersion="10.0.0.0" MaxVersionTested="10.0.0.0" />

<TargetDeviceFamily Name="Windows.Desktop" MinVersion="10.0.0.0" MaxVersionTested="10.0.0.0" />

我正在构建一个仅限桌面的应用程序...在代码执行期间没有发出任何警告,没有任何信息可以让我发现该更改的影响。为什么,哦,为什么?

那么为仅限桌面的 UWP 应用程序声明 TargetDeviceFamily 的正确方法是什么???

圣母我生气了吗...

这是我在 windows 10.0.15063 sdk 中测试过的解决方案 按照以下步骤操作:

1)

<TargetDeviceFamily Name="Windows.Desktop" MinVersion="10.0.15063.0" MaxVersionTested="10.0.15063.0" />

2) 然后转到参考并右键单击它,然后单击 "Add refernece"。

3) 然后在Extensions中添加相应的uwp desktop extension(如截图所示)。

4) 现在构建和调试您的 "gif" 将开始动画。

:)