加入收藏 | 设为首页 | 会员中心 | 我要投稿 辽源站长网 (https://www.0437zz.com/)- 云专线、云连接、智能数据、边缘计算、数据安全!
当前位置: 首页 > 服务器 > 系统 > 正文

xaml – Windows应用程序项目中不支持Type

发布时间:2021-03-07 11:13:34 所属栏目:系统 来源:网络整理
导读:如何从XAML样式或模板引用类型? WPF语法在我的 Windows应用商店项目中不起作用. IDE咆哮着“在Windows应用程序项目中不支持类型”. 解决方法 使用以下语法: Style TargetType="xmlNamespacePrefix:MyControlClassName" ... 也就是说,您不需要在Windows应用

如何从XAML样式或模板引用类型? WPF语法在我的 Windows应用商店项目中不起作用.

IDE咆哮着“在Windows应用程序项目中不支持类型”.

解决方法

使用以下语法:

<Style TargetType="xmlNamespacePrefix:MyControlClassName" >
    ...

也就是说,您不需要在Windows应用商店和手机应用中使用{x:Type}语法.

MSDN说:

If you have used XAML for Windows Presentation Foundation (WPF),then
you might have used an x:Type markup extension to fill in any XAML
values that take a System.Type. The Windows Runtime XAML parser does
not support x:Type. Instead,you should refer to the type by name
without using any markup extension,and any necessary XAML-to-backing
type conversion is already handled by the built-in conversion behavior
in the XAML parser.

http://msdn.microsoft.com/en-us/library/windows/apps/windows.ui.xaml.style.targettype

(编辑:辽源站长网)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读