Back in February, I posted my Windows Phone starting template, which serves as a helpful base to start developing Windows Phone apps. It provides some useful basics, such as review reminder, storage helper, settings and about pages and has its own MVVM implementation without relying on third party frameworks. The template also helps developers build for both Windows Phone 7 and Windows Phone 8 natively, while maximizing code reuse between these two solutions, thus resulting in less development effort to support both versions of Windows Phone.
Today, I’d like to share my more generic Windows starting template, which builds on the Windows Phone starting template, while adding support for Windows 8 apps and providing more helpful features to enable code reuse between these two platforms. As this is an extension of the Windows Phone starting template, I’ll only highlight the new features of this starting template here, so I encourage you to read the original post on what’s there for the Windows Phone side of things.
Windows 8 additions
The original template contained helpers to provide easy access to Storage and remind users to review the app. These have been rewritten for Windows 8 and are included in the new WindowsMultiOSApp.Common.Win project. The Storage helper saves the data in ApplicationData.RoamingFolder, so the settings in this app are automatically synced across Windows 8 devices.
The newly introduced MovieService, which grabs some movies from imdbapi.org utilizes the Microsoft.Net.Http library to unify the web request API to Windows 8’s HttpClient. This means both Windows 8 and Windows Phone projects can now use HttpClient to do web requests.
The Commands and Converters have been extended with Windows 8 specific implementations using PRAGMAs, so these don’t have to be maintained in two different files.
I’ve chosen not to utilize a Settings Flyout implementation, such as from Tim Heuer’s Callisto, to provide clear insight as to how a Flyout works. The SettingsCharm.cs file is mostly made up from code of the App settings sample on MSDN with some added events that are fired when the Flyout is shown or hidden.
Windows 8 view
There’s one page in the Windows 8 project: MainPage. The important thing to take away from this page is that it does not use the default page layout of a single GridView with multiple groups, but instead it has a ScrollViewer with two ItemsControls stacked next to each other. This allows for completely different item template, while still maintaining the default C-shape Windows 8 app, complete with group header styles.
As usual, download the solution below and let me know if you encounter any issues or have feedback of other sorts in the comments below or on Twitter! I do intend to update this starting template when access to the Windows 8.1 SDK is available.
[download id=”3352″ data=”title”]