加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > Windows > 正文

windows-phone-7 – WP7中是否有Label控件?

发布时间:2020-12-14 02:55:55 所属栏目:Windows 来源:网络整理
导读:WP7中是否有Label控件?我不介意从头开始重新创建它,但如果我不需要,我不想重新发明耳环. 解决方法 不支持标签,但您可以使用 TextBlock.然而,它不是直接的替代品,this post强调了一些差异. Even though TextBlock lives in the System.Windows.Controls name
WP7中是否有Label控件?我不介意从头开始重新创建它,但如果我不需要,我不想重新发明耳环.

解决方法

不支持标签,但您可以使用 TextBlock.然而,它不是直接的替代品,this post强调了一些差异.

Even though TextBlock lives in the System.Windows.Controls namespace,
it is not a control. It derives directly from FrameworkElement.
Label,on the other hand,derives from ContentControl. This means
that Label can:

  1. Be given a custom control template (via the Template property).
  2. Display data other than just a string (via the Content property).
  3. Apply a DataTemplate to its content (via the ContentTemplate property).
  4. Do whatever else a ContentControl can do that a FrameworkElement cannot.

But be aware! The use of Label is a way more heavy then TextBlock due to its Visual Tree. …

(编辑:李大同)

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

    推荐文章
      热点阅读