windows-phone-7 - WP7 中是否有标签控件?

标签 windows-phone-7

WP7 中是否有标签控件?我不介意从头开始重新创建它,但如果我不需要,我不想重新发明凸耳螺母。

最佳答案

不支持标签,但您可以使用 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. ...

关于windows-phone-7 - WP7 中是否有标签控件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8752515/

相关文章:

xaml - TextBlock 中的多种颜色

mobile - 如何在 WP7 上创建动画磁贴?

c# - WP7-对网络通信、跨线程访问和连续传递感到困惑

c# - 在 C# .NET Silverlight 中,如何根据字典中键中的值对字典列表进行排序?

windows-phone-7 - 带有 Windows Phone 7 的 Visual Studio 2015

c# - 将 PNG 图像保存到 WP7 的隔离存储

c# - Canvas 作为 ListBox ItemTemplate

c# - 将 XML 中的 ebay web 服务响应转换为 C# 对象?

windows-phone-7 - 如何从 Windows 7 手机的列表框中删除项目?