Gurunathan
Gurunathan

Reputation: 467

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.

Upvotes: 0

Views: 669

Answers (1)

Sopuli
Sopuli

Reputation: 421

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.

Upvotes: 2

Related Questions