Bridging the WinPhone to UWP Gap...
One of the questions I hear allot is how do you convert your Windows phone 8/8.1 Silverlight app into a Windows 10 UWP app? Is there a simple converter?
But one is the works!
Mobilize.NET, the company that brought us the cool WinForm to Web App product, WebMAP2 have just released a new Visual Studio Extension that, while work-in-progress and in preview, will help you convert your WP8/8.1 Silverlight app into a W10 UWP app, with just a couple clicks.
Today marks the initial release of Mobilize.NET’s Silverlight bridge, which helps Windows Phone Silverlight app developers bring their WP Silverlight 8.x apps to the Windows 10 Universal Windows Platform (UWP). Announced at Build 2015, the Moblize.NET bridge is free and directly integrates into Visual Studio. The bridge currently maps the 700 most used APIs and handles transitioning your manifests, APIs, XAML, NuGet package references and async/await changes. More APIs and mappings will follow with future updates. Mobilize.NET has a much more in-depth post on the Silverlight bridge that goes into detail on the features, so here we share only a high-level overview of the tool.
Once you use the tool to bring your app to the UWP, your app will have all the power of a UWP app, including the ability to – from a single code base – run on a PC, phone, Xbox, HoloLens, or even a Raspberry Pi.
Running the bridge
Once installed, open up Visual Studio, load your WP Silverlight app, then right-click your project from the Solution Explorer and select the “Convert to UWP” option. Additionally, any project that is in the solution will be migrated.
The Silverlight bridge may not do a full transition as this is an initial preview now but the tool should get you most of the way. Since Silverlight is similar to UWP but not the same so most errors should be pretty straightforward to resolve. Once you fix compiler errors, you should be ready to start testing and adjusting your app.
One of the cool announcements Microsoft made around the Windows 10 launch was the Universal Windows Platform (UWP), a single executable that can run on any Windows 10 device, from the Surface to a desktop to a Raspberry Pi. And to support this, Visual Studio 2015 makes it easy to create these apps from a single solution with a single project.
Prior to UWP, about half of all Windows Phone apps were written using WPS (Windows Phone Silverlight). These apps will need significant changes in order to be compatible with the UWP platform. However, once migrated to UWP, those apps can run on all Windows 10 devices. So this creates a lot of new opportunities for app developers.
To jumpstart this development, Mobilize.Net has created a free tool called Mobilize.Net Silverlight bridge that automates a big part of the conversion process from Windows Phone 8.x code to UWP. An extension to Visual Studio, the tool takes as input your existing projects for both application code and class libs and outputs a new UWP project, converting C# and XAML files to the new UWP platform.
Suppose using Visual Studio 2013 you had created a Windows Phone Silverlight app (“CalculatorWP”):
Loading that project into Visual Studio 2015 with Mobilize SL bridge installed would create a new UWP project like this:
Getting and running the tool
The tool is a free Visual Studio extension. A technical preview is available for download immediately from http://www.mobilize.net/uwp-bridge. Once you download the tool and run the MSI installer, Mobilize SL bridge becomes available as a Visual Studio extension. Open Visual Studio and load your WPS application, then right click your project from the "Solution Explorer" and select the "Convert to UWP" option. The following dialog shows up:
There’s a huge number of Windows Phone Silverlight specific APIs either included with the framework or provided by third party vendors. Mobilize SL bridge comes with a set of 700 mappings in its first release (technical preview) and will grow up to 1200 in a couple of months. The APIs that ship with Mobilize SL bridge handle the most common scenarios based on counting which APIs are used most in Windows Phone apps.
If your application uses a specific API extensively that is not included in the tool, you can save manual work by taking advantage of the Mobilize SL bridge Extensibility Mechanism.
In order to make writing custom mappings a good experience, Mobilize.Net has provided the following:
- All mappings bundled with the tool have been open sourced and published in a public GitHub repository (https://github.com/MobilizeNet/UWPConversionMappings). This way developers all around the world can use them as a reference implementation to write their own.
- Usage and reference documentation is provided in the same GitHub repository inside the Wiki section.
- In order to use custom mappings in the tool, a developer only needs to copy their own XAML mapping files inside of "%localappdata%\Mobilize.NET\WinPhone2UWP\Mappings". Mobilize SL Bridge will automatically load them the next time it runs.
- Because of the nature of GitHub collaboration, developers can either share their own mappings or reuse mappings created by other developers, or even improve core tool mappings by using the GitHub Pull Request feature.
Timing and Availability
The tool is free and a technical preview is available for download immediately. It includes 700 mappings and more mappings are being developed. All 1200 mappings will be completed in early November. You can download the tool at http://www.mobilize.net/uwp-bridge.