All of the code samples I have previously posted were built on the Consumer Preview (CP) bits so I thought I would attempt at converting the app to the just announced Release Preview (RP).
I had to do a couple of things to get my app up and running on RP from the CP bits. I will break it down into the following five categories.
1 - Project Templates
I found the easiest way to save time was to start a new project and then copy/paste over my old files in. This ensured I didn’t miss any of the new project/solution settings..
2 – WinJS References
The WinJS library file has been updated from version 0.6 to 1.0.RC. I went into my default.html file and referenced the updated libraries.
3 – New Variable References
After the creation of the app reference to WinJS.Application there is a new activation variable referencing Windows.ApplicationModel.Activation as well as a call to WinJS strictProcessing. I made sure to include these in my default.js as well. The strictProcessing call will opt your app in to improved error handling.
4 – Application Activation
The way that the app.onactivated event is called has been changed. The checks for termination and resuming have now been created for you. I made sure to include the update checks.
5 – Handling ViewState (Snapped, Filled, Fullscreen)
The Event Handler for ViewState has been greatly simplified. Instead of worrying about viewstatechanged on the current ApplicationView we simply add a resize Event Handler to the window object.
Getting the current ViewState inside our Event Handler has been updated too. Instead of looking at the eventArgs we now grab the value of Windows.UI.ViewManagement.ApplicationView.
Pretty easy update with only five things to think about. Hopefully this post will help aid you in converting over your own CP apps to RP! I’ll be doing additional testing over the next few days and will post anything I find here as well as any official update guidance that gets released.
If you are currently working on a Windows 8 app and want to get into the Windows Store I would love to hear about it! You may also want to check out my previous Windows 8 Metro Style Development Tips:
- Using KnockoutJS in Windows 8 Metro Style Apps
- Illegal characters in path when deploying a Metro Style App
- Connecting to WCF RIA Services in a Windows 8 Metro Style App using Upshot.js and Knockout.js
- Help! Visual Studio 11 Beta Dark Theme incorrectly using White Background
- “The application could not be started.” error when debugging a Windows 8 Metro Style App