I started working on my WP7 again, only to discover that I need some form of tabbing on it, and having investigated Pivot Controls but never use it, now would be the best time to look into in depth.
Having used the tag <controls:Pivot >….</controls:Pivot> inside the <Grid> tag, Visual Studio didn’t recognise this tag, baffled I looked a various samples, but most of them seem to point that you need the controls tag, else there was no namespace for WP7 to adhere to.
Upon discovery by accident, I realised from the Panorama demo, you must require the header reference in the XAML, the naming inside the PhoneApplicationPage: -
xmlns:controls="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls"
Finally I could get the Pivot Controls working as a result
You can denote your Pivots as structured below as the barebones: -
<controls:Pivot Title="header" Name="pivot1">
<controls:PivotItem Header="item1">
………..contents of PivotItem of item1 here…….
</controls:PivotItem>
<controls:PivotItem Header="item2">
………..contents of PivotItem of item2 here…….
</controls:PivotItem>
<controls:PivotItem Header="item2">
………..contents of PivotItem of item3 here…….
</controls:PivotItem>
</controls:Pivot>
Having seen the way Pivots are structured, they seem very simple to code, and for effective as a result, and makes your application less cluttered and more ordered in its layout.
No comments:
Post a Comment