I’m having a hard time trying to display how my textblock look like in the pivotitem. How do i make it look like the default one where u will get when u create a pivot project?
Thanks! 🙂
private void LoadFromLocalStorage()
{
using (IsolatedStorageFile store = IsolatedStorageFile.GetUserStoreForApplication())
{
string[] fileNames = store.GetFileNames();
foreach (string s in fileNames)
{
TextBlock txt = new TextBlock() { Text = s };
container.Children.Add(txt);
//PivotItem pitem = new PivotItem(); //create pivotitem
//pitem.Content = //set pivotitem content
//MyPivot.Items.Add(pitem);//Add pivotitem to your pivot
}
}
}
XAML
<controls:Pivot Title="MY APPLICATION">
<!--Pivot item one-->
<controls:PivotItem Header="item1">
<StackPanel x:Name="container"></StackPanel>
</controls:PivotItem>
Edit the
HeaderTemplateof the Pivot. Here’s the default template:use like
edit: if you’re trying to display your items in the PivotItem, you should use a ListBox.
Add this to the top of the Page XAML.
Inside your PivotItem, add a listbox:
Then, change your function for getting filenames:
Here, the listbox ‘ItemSource’ is set to the list of filenames.
If this isn’t familiar to you, you should go through some WP7 tutorials. It is pretty basic.
http://create.msdn.com/en-us/education/quickstarts