Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a Label control in WP7?

Is there a Label control in WP7? I don't mind recreating it from scratch, but I don't want to reinvent the lug nut if I don't have to.

like image 584
Jonathan Allen Avatar asked Jan 06 '12 01:01

Jonathan Allen


2 Answers

Labels are not supported, but you can use a TextBlock instead. It's not a direct replacement, however, and this post highlights some of the differences.

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. ...

like image 124
keyboardP Avatar answered Oct 26 '22 02:10

keyboardP


According to this video (0:52) Label is unsupported.

like image 42
CRM Avatar answered Oct 26 '22 03:10

CRM