简体   繁体   中英

Windows phone 8 placeholder issue with Windows Phone Toolkit

I'm developing a windows phone 8 app. I'm new to windows phone 8 development.

I need to add placeholder for text box . I searched in Google & Stack Overflow i got one solution by using The windows phone Toolkit.

I try with following Code.

Step-1: Add Windows Phone Toolkit In Reference By Using Nuget gallery

Step-2: Add namespace in page header

 xmlns:xtk="using:WinRTXamlToolkit.Controls"

Step-3: My Textbox XAML code

<TextBox Name="Usernametxt" Text="User Name"></TextBox>
<TextBox Name="Passwordtxt" Text="Password"></TextBox>
<TextBox Name="Emailtxt" Text="Eamail Address"></TextBox>

Step-4: I add the following code under the Usernametxt box [I don't know it's correct or not]

<xtk:WatermarkTextBox  WatermarkText="some text" />

I got error in above line The Name WatermarkTextBox does not exist in namespace"using:WinRTXamlToolkit.controls"

I got this solution Here

I don't know how to use this property . I need to add placeholder for 4 to 5 textbox in same page.

Help me to solve this problem.

You are mixing up Windows Phone 8 and Windows 8. You need a reference to correct toolkit

xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"

And then you can

<toolkit:PhoneTextBox Hint="some text" Name="Usernametxt" />

Make sure you can got the right Nuget package, more details here .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM