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:
- Be given a custom control template (via the Template property).
- Display data other than just a string (via the Content property).
- Apply a DataTemplate to its content (via the ContentTemplate property).
- 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/