Converting from Silverlight To Universal Apps – Xaml Stuff
Converting a Windows Phone Silverlight app to a Universal WinRT app isn’t straight forward, and it’s hard to Google for answers. I converted one of my not too advanced apps to universal Windows/Phone and here are some of the things I had to do.
The xaml needs a lot of changes… and here’s the quick-list of things I needed to change in my XAML views to make them work in universal winrt.
The XAML quick-list
1) In the “header”, change the type PhoneApplicationPage to Page (obviously in the code behind too).
2) Remove the SupportedOrientation and Orientation properties from the Page tag.
3) Remove the SystemTray properties from the Page tag.
4) Remove all references to StaticResource-properties that reference Phone* stuff.
5) If you use TransitionService-stuff from the Windows Phone Toolkit – remove them! You get basic transitions set up for free in the new App-class you get from a new universal project.
6) If you use transparent background in your page, grid or controls, change to the new ThemeResource ApplicationPageBackgroundThemeBrush. This will reflect the theme background on your phone and/or computer and works as expected on Windows too.
7) Change your ListBox controls to ListView.
8) Convert your ApplicationBar to use the new BottomAppBar instead.
I’ll post some more details about commands and styles soon.