
When you're done, you'll have removed all Windows Phone Silverlight namespaces.
Vectorial map windows phone code#
You can remove the using directive, and that will be all it takes to port code like that in the snippet above.


In this case, the Windows.UI. namespace is added, which is where the type lives in the UWP. In a case like this, you can right-click the type name ( BitmapImage) in Visual Studio and use the Resolve command on the context menu to add a new namespace directive to the file. For example, you might find that a line of code like this one doesn't compile yet: return new BitmapImage(new Uri(this.CoverImagePath, UriKind.Relative)) īitmapImage is in the namespace in Windows Phone Silverlight, and a using directive in the same file allows BitmapImage to be used without namespace qualification as in the snippet above. Another place is any code-behind files that directly manipulate UI elements. Your view models are one place where there's imperative code that references UI types. In the UWP, omit the "System" prefix declaration and use the (already declared) "x" prefix instead: 40 You may have a resource whose type is defined by the system: xmlns:System="clr-namespace:System assembly=mscorlib" Xmlns:ContosoTradingLocal="using:ContosoTradingLocal" The result looks like this: xmlns:ContosoTradingCore="using:ContosoTradingCore" Xmlns:ContosoTradingLocal="clr-namespace:ContosoTradingLocal"Ĭhange "clr-namespace" to "using" and delete any assembly token and semi-colon (the assembly will be inferred). Here are some examples: xmlns:ContosoTradingCore="clr-namespace:ContosoTradingCore assembly=ContosoTradingCore" The syntax of these differs between Windows Phone Silverlight and the UWP. If you use instances of custom types in your views-perhaps a view model instance or a value converter-then you will have XAML namespace prefix declarations in your XAML markup. So, you can change all elements to (don't forget property element syntax) and you can delete the xmlns:phone declaration.įor a more general approach to finding the UWP type that corresponds to a Windows Phone Silverlight type, you can refer to Namespace and class mappings.

If you open that version of MainPage.xaml, you'll see that at the root is the type Page, which is in the Windows.UI.Xaml.Controls namespace. In the previous topic, you saved a copy of the XAML files that Visual Studio generated when it created the Windows 10 project. One of the first issues you might notice highlighted in the Visual Studio XAML designer is that the PhoneApplicationPage element at the root of your XAML file is not valid for a Universal Windows Platform (UWP) project.
Vectorial map windows phone how to#
The previous topic showed you how to copy your XAML and code-behind files into your new Windows 10 Visual Studio project. Much of the imperative code in your presentation layer-view models, and code that manipulates UI elements-will also be straightforward to port. You'll find that large sections of your markup are compatible once you've updated system Resource key references, changed some element type names, and changed "clr-namespace" to "using".

The practice of defining UI in the form of declarative XAML markup translates extremely well from Windows Phone Silverlight to Universal Windows Platform (UWP) apps.
