Issue with x:TypeArguments and generic List class in XAML

守給你的承諾、 提交于 2019-12-05 03:05:32

I've just tested your sample with Internet Explorer 9. IE9 uses PresentationHost.exe to render the content and on my system (Windows 7 SP1 x64), and by examining which assemblies are actually loaded I confirmed that it uses the v3.0 framework which does not support XAML 2009.

The documentation describes that for XBAPs it chooses which framework version to load and so it is clearly capable of using the v4.0 framework which does support XAML 2009 for loose XAML. However, the documentation unfortunately does not say which version of the framework it will choose for loose XAML as opposed to XBAPs.

Empirically, at least with your sample, I can confirm that PresentationHost.exe chooses the v3.0 framework. I cannot find any way to override this selection, for example by annotating the XAML somehow.

The issue has been resolved. I needed to include the following namespace mapping in the markup to enable use of generics.

xmlns:v4="http://schemas.microsoft.com/netfx/2009/xaml/presentation"

Now it works fine.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!