Is there any "placeholder type" property availble for textbox in xaml in windows phone 8
标签:
windows-phone-8
相关问题
- How to access the camera from my Windows Phone 8 a
- How to append a file, asynchronously in Windows Ph
- Save pictures to custom folder in media library
- How to show/hide (with animation if possible) a Ch
- How to debug running out of memory on Windows Phon
相关文章
- LongListSelector on WP8 linq-to-sql binding issue
- How to free image cache/memory in Windows Phone 8?
- WP8 HttpClient.PostAsync never returns result
- FlipView control is not available in Windows Phone
- Implement AddRange on ObservableCollection with pr
- Does Thread.Sleep affect the ThreadPool?
- AdMob Interstitial Cocos2d-x WP8
- Technology for video encoding and decoding on Wind
My solution is based on the answer of PKENO
XAML (UserControl):
Code behind UserControl:
XAML (in Window):
Probably not the most efficient way, but it works.
There is the PhoneTextBox in the official Windows Phone Toolkit, covered here.
Sample code:
To add toolkit to your project : Type the following into your package manager console :
PM> Install-Package WPtoolkit
And
inside
<phone:PhoneApplicationPage
tag in thexaml
pageThere is no placeholder property for TextBox. I use the following solution to work around this for a username textbox:
XAML:
Code:
This basically replaces the TextBox with a Grid-element, containing a TextBox and a TextBlock (working as placeholder). Then when the textbox is focused, the textblock is hidden, and when it looses focus the textblock is shown if the textbox is empty.
Try like this below code: