It looks like that the Header property isn't supported by System.Windows.Controls.TextBox! WHY?
But the screen-shot at http://msdn.microsoft.com/en-us/library/hh202916%28v=vs.92%29.aspx claims that there is a Header property for TextBox!?
I am confused ... Also PhoneTextBox does not support a Header property?
See also:
TextBox Control Design Guidelines for Windows Phone:
http://msdn.microsoft.com/en-us/library/hh202916%28v=vs.92%29.aspx
Workaround for headers on TextBox controls:
http://forums.create.msdn.com/forums/p/77167/468516.aspx
Is it possible to add a Header property to the textbox control:
http://forums.create.msdn.com/forums/p/76127/576970.aspx
So I am not completely alone with that TextBox.Header question ... But what is the one and only answer for TextBox.Header? Even the MSDN article "TextBox Control Design Guidelines for Windows Phone" shows a screen-shot of TextBoxes using Header and pointing to System.Windows.Controls.TextBox that control does not support it!?
The workaround by "EGL" looks nice but how to define the InputScope (for example when I just need "Numbers") in XAML? Thank you for bringing some light into the dark ;-)
--Harald-René Flasch (aka hfrmobile)
Comments: ** Comment from web user: hfrmobile **
Thank you for your reply!
Yes, I just liked a "HeaderedTextBox" as described in this MSDN article:
http://msdn.microsoft.com/en-us/library/hh202916%28v=vs.92%29.aspx
They're just talking about "TextBox" and not TextBlock/TextBox ... ;-)
For me it was strange since <toolkit:TimePicker>, <toolkit:ToggleSwitch>, <toolkit:ListPicker> etc. supporting such a Header "natively".
So I ended up writing a TextBoxWithHeader control (UserControl) on my own so that I can easily implement a Metro UI.
I implemented my TextBoxWithHeader control exactly the way you mentioned: <StackPanel><TextBlock /><TextBox /></StackPanel> ... But is it really so bad doing it that way? Don't see another easy way doing it.
Example: http://www.hfrmobile.com/app_Taxometer_T1/index.htm