I have been playing with the Windows Phone 7 Toolkit all day long (Saturday), all while reading Charles Petzold’s eBook
brought to us for free by Microsoft Press.
Time for this 1013-page book couldn’t have been better as it provides us with insights into WP7 development right at the time WP7 phones are becoming available to consumers.
We greatly appreciate and acknowledge the cost Microsoft must have incurred and the big time sacrifice Charles must have made to get that high quality book publicly available in record time.
As I am working on our first Windows Phone 7 Application, we decided to encapsulate a functional area as a Windows Phone User Control and to include a Panorama control within. Online articles consistently demonstrated the Panorama control when defined in a Windows Phone Panorama Page. Additionally, the Panorama control is not available in the Toolbox for easy inclusion in a custom control.
In playing a bit with the Panorama control, I found a quick way to include it in our Windows Phone Control page without investing much effort:
1-Add a new Windows Phone Panorama Page to project. This will automatically add references to Microsoft.Phone.Interop, Microsoft.Phone.Controls in addition to the Microsoft.Pone DLL already referenced by default.
2-Copy the generated namespaces from Windows Phone Panorama Page to User Control XAML page.
3-Copy the generated Panorama control XAML markup from the Windows Phone Panorama Page to the location desired within the Windows Phone User Control XAML.
<controls:Panorama Title="my application">
<!--Panorama item one-->
<!--Panorama item two-->
4-Delete the Windows Phone Panorama page created in step 1 since we didn’t need it in the first place.
5-Ask a friend to pat you on the back for being so efficient and quick.