I’ve just returned from the Build 2014 conference in San Francisco where I had the opportunity to attend several interesting sessions about new developments in the Microsoft space.
One of the “big news” has been the introduction of the concept of “Universal Windows Apps“, a great way to share code between different platforms including (but not limited to) Windows Phone, Windows Store and Xbox One apps.
I decided to test this new feature on TypedMVVM, one of my “pet projects” which I made available on CodePlex some time ago. The project was originally using a simple MVVM infrastructure targeting Windows Store apps using WinJS and TypeScript so it was an ideal candidate for adding a Windows Phone 8.1 target reusing all the existing code.
The migration to Universal Apps was really straightforward: I was able to have the samples up and running in my emulator and devices while waiting at the airport in San Francisco.
I’ve uploaded all the source code on Codeplex here, feel free to grab and give it a try.
To enable your project for MultiTouch, just run the following command in the Package Manager Console and all the libraries and dependencies will be added to the Visual Studio project:
PM> Install-Package MultiTouchBehaviors
Alternatively just search for the package selecting Tools->Library Package Manager->Manage NuGet Packages for Solution from Visual Studio 2012.
If you are interested in creating a NuGet package for your open-source project, register an account herein the gallery and follow the instructions described in the section “Creating and Publishing a Package“: they are very clear and contain detailed information about the process.
The package definition for MultiTouch is also available in the Source Code section on CodePlex.
Unfortunately I hadn’t the possibility to participate at the conference but had some free time during the week-end to watch some of the recorded sessions available here on Channel9: this is really a great resource and I suggest everyone interested in Microsoft technologies to download some videos and have fun with it.
I decided then to take a look at the new features available in Windows Phone 8 and the related SDK: Justin Angel has a great article about this topic in the Nokia Developer Community.
To get my hands dirty I moved then on my personal Open-Source project “Multi-Touch Behaviors” on CodePlex: this is a set of Epression Blend Behaviors for different platforms including Windows Phone, Silverlight and WPF for applying gestures and manipulations (like the one available in the “old” ScatterView control) to generic XAML elements.
The project was not yet updated to Windows Phone 8 so I took this opportunity and experimented with the new SDK: this was really a great experience since I was able to upgrade quickly all my samples to the new platform using the same codebase used for the Silverlight version.
Unfortunately I haven’t the possibility to test the performance on a real Windows Phone 8 device at the moment but the first impressions are really positive.
I have already checked in the code for WP8 here, I’m planning more testing and development in the future.
The WPSDK 7.1.1 Update provides a WPSDK patch that enables developers to develop and test for the recently announced Windows Phone 7.5 256 MB devices, as well to run the WPSDK 7.1 on the Windows 8 Consumer Preview release via the following:
Updated 512 MB OS Emulator Image: An updated build Windows Phone OS 7.1 (Build 8773)
New 256 MB OS Emulator Image: A new Windows Phone OS 7.1 emulator image (Build 8773) that emulates running on 256 MB devices
Emulator Choice: Ability to debug or run your WP apps in either the 256 MB or 512 MB emulator
Windows 8 Support: An updated emulator is included, which can run on Windows 8
IntelliSense support for adding the new 512 MB requirement to the Windows Phone App Manifest file
News since the CTP release last month:
‘Go Live’ license: The update now has a ‘Go Live’ license; developers running WPSDK 7.1.1 are now empowered to publish their Windows Phone apps to the Windows Phone Marketplace
Full Localization: WPSDK now supports all 10 IDE languages; and the OS image now has Malay and Indonesian
Windows 8 Support: The updated emulator will now run on Windows 8; note that the OS is still not officially supported by developer support until the final OS release
Windows Phone SDK 7.1.1 Update CTP Download Center page
This new implementation, now available for download in the Expression Gallery, permits to enable Multi-Touch gestures (the usual translation, rotation, zoom and inertia) on separate User Controls available in the same container.
In this way you can apply distinct Multi-Touch manipulations (inertia included) to single elements using a single code in xaml:
Alternatively you can use Blend inserting a reference to the project MultiTouch.Behaviors.Silverlight.WP7 and then dragging the MultiTouchManipulationBehavior from the Assets section to the control to be touch-enabled:
This one has been an interesting exercise in porting code written for Silverlight to Windows Phone: I had only to create a Windows Phone 7 project and add to it the code already available for the Silverlight version and all worked well quite quickly.
At this time the behavior works only in the fixed Portrait orientation of Windows Phone: if you change to Landscape the manipulation doesn’t work well. I’ll have to investigate further and currently I don’t have a physical device to test (I’d really love to have a device to try it :)).