什么取消了XAML中的“默认"属性? [英] What deremines the 'deafult' property in XAML?

查看:57
本文介绍了什么取消了XAML中的“默认"属性?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在XAML中,我可以如下设置TextBlock的Text属性:

In XAML I can set the Text property of a TextBlock as follows:

<TextBlock Text="Data"/>
<TextBlock>MoreData</TextBlock>

我的问题是后者-系统如何知道将'MoreData'分配给Text属性?

My question is about the latter - how does the system know that 'MoreData' is to be assigned to the Text property?

谢谢

Cap'n

推荐答案

以下链接说明了如何确定:

The following link explains how that is determined:

http://msdn.microsoft.com/zh-cn/library/system.windows.markup.contentpropertyattribute.aspx

http://msdn.microsoft.com/en-us/library/system.windows.markup.contentpropertyattribute.aspx


这篇关于什么取消了XAML中的“默认"属性?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆