Skip to content

Not upgraded elements

ldfallas edited this page Oct 7, 2015 · 2 revisions

Some Windows Phone Silverlight API elements may not have equivalence in UWP.

In this scenario the tool generates an entry on the conversion report and comments on the source code that indicate places on the code where the tool identified an element without equivalence on the target platform.

For example:

-- Windows Phone Silverlight --

aTextBox.TextDecorations = TextDecorations.Underline;

Suppose that in this scenario the mapping for 'System.Windows.Controls.TextBox' indicates that the TextDecorations property has not equivalence on the target platform.

Then the generated code will have the following element:

-- UWP --

//WINDOWS_PHONE_SL_TO_UWP: (1101) System.Windows.Controls.TextBlock.TextDecorations was not upgraded
aTextBox.TextDecorations = TextDecorations.Underline;

As expected this code will not compile on UWP since the System.Windows.Controls.TextBox.TextDecorations property does not exist on UWP.

Also an entry on the conversion report is generated for this scenario

Xaml

This kinds of situations may also occur in XAML mappings. For example:

-- Windows Phone Silverlight --

<TextBlock x:Name="someTb" Text="page name" Margin="9,-7,0,0"  TextDecorations="Underline"/>

Suppose that in this scenario the mapping for 'System.Windows.Controls.TextBox' indicates that the TextDecorations property has not equivalence on the target platform.

Then the generated code will have the following element:

-- UWP --

<TextBlock x:Name="someTb" Text="page name" Margin="9,-7,0,0">
     <!--TextDecorations="Underline"-->
</TextBlock>

What the conversion tool knows and what it doesn't

The 'not upgraded' error/warning is generated only when the creator of a mapping explicitly indicated that an element has no equivalent on UWP.

This can be accomplished by using the MarkAsNotMapped code action or the MarkAsNotMapped XAML mapping action.

For API that have no mapping the tool generate a different warning. For example:

The tool does not have information on the 'DatePicker' XAML element with namespace 'clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit'

This message indicates that the tool doesn't know if the given API or XAML element has a valid conversion to UWP.

Overview

Writing mappings

Code Mapping Actions

Code Mapping Conditions

XAML mapping actions

XAML mapping conditions

Misc

Clone this wiki locally