1. Add Reference to Microsoft.Phone.Controls dll
2. Add xmlns:controls attribute
xmlns:controls="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls"
3. Use it
<controls:Pivot Title="Pivots"> <contr...
[More]
Xaml Codes:
The code way to show data with ListBox:
Use ListBox with DataTemplate:
…
…
DataTemplate seems more elegant and easy to use.
First, define a Class People:
Xaml elements are going to bind with object of People.
Then, Create an instance in the Windows Page's construction method:
Now, with the last line of code:
this.stackPanel.DataContext = myData;
myData object is now binding with elements