Moving from Silverlight to WinRT

Moving onto the new WinRT platform is not a zero-cost exercise for existing applications. The UI controls that you interact with are just one example of the API change between Windows Phone Silverlight and Windows Phone WinRT applications. Silverlight controls live within the Microsoft.Phone.Controls namespace, whereas WinRT components live under Windows.UI.Xaml. The UI elements are similar, but not the same.

There is another fact that is important to understand: WinRT for Windows and WinRT for Windows Phone are very similar APIs, but they are not identical. Although there is considerable overlap, there are items that exist in the phone library that don’t exist in the windows library, and vice versa. You can envision the Venn diagram (see Figure 24.8). This is not unexpected. Device capabilities will be different between laptops and desktops and tablets and large format phones and small format phones. This sliding window of capabilities is a core focus of Microsoft as it tries to homogenize its OS and deliver a core environment that scales across all devices.

Image

FIGURE 24.8 WinRT for Phone versus Windows.

There are, of course, other differences to consider. WinRT offers you the ability to build your applications using HTML. So one decision you will be faced with is whether to continue down the XAML path or adopt an HTML/JavaScript-centric view of the world. Page navigation and lifecycle events are similar but certainly changed. And there are a score of equivalent, but different, classes residing in different areas of both the Phone class libraries and .NET proper. The MSDN dev center offers up an article titled “Windows Phone Silverlight to Windows Runtime Namespace and Class Mappings” that is highly suggested reading.

We’ve covered some of these controls already in our Chapter 23 coverage of building a Windows Store application. We’ll cover some more here and review some of the new WinRT control equivalents to their “old” Silverlight counterparts.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset