Skip to content

MarkAsNotMapped Xaml Mapping Action

ldfallas edited this page Aug 31, 2015 · 3 revisions

Description

Comments out the specified Xaml element or property. This action also generates a messages that will be added to the migration report indicating that manual changes may be required after the migration.

The element or property which is the target of this mapping action will be commented out.

Properties

​Property ​Usage ​Description
​ElementName ​Optional The new of the original element used to generate the error report. This is required when the container element is renamed.

Example

Say that we want to mark the SupportedOrientations property as not supported. The following mapping uses the MarkAsNotMapped mapping action to do this task.

<MapUnit xmlns='clr-namespace:Mobilize.Mappers.Extensibility.Core;assembly=Mobilize.ExtensibleMappers'
         xmlns:xmap='clr-namespace:Mobilize.XamlMappers;assembly=Mobilize.XamlMapper'
         xmlns:x='http://schemas.microsoft.com/winfx/2006/xaml' >
    <MapUnit.Elements>
        <xmap:XamlElementMapper ElementName="PhoneApplicationPage"
                                ElementNamespace="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone">
            <xmap:XamlElementMapper.Maps>
                <xmap:XamlMap Kind="Element">
                    <xmap:XamlMap.Action>
                        <xmap:RenameElement NewName="Page"
                                            NewNamespace="http://schemas.microsoft.com/winfx/2006/xaml/presentation" />
                    </xmap:XamlMap.Action>
                </xmap:XamlMap>
                <xmap:XamlMap Kind="Property" PropertyName="SupportedOrientations" >
                    <xmap:XamlMap.Action>
                        <xmap:MarkAsNotMapped ElementName="PhoneApplicationPage" />
                    </xmap:XamlMap.Action>
                </xmap:XamlMap>
            </xmap:XamlElementMapper.Maps>
        </xmap:XamlElementMapper>
    </MapUnit.Elements>
</MapUnit>

Notes

  • It is important to specify the ElementName attribute to generate a correct error report. If the container is being renamed and this attribute is not used, the name of the target element is generated as part of the error message.

  • This mapping action can be used with properties and elements.

Overview

Writing mappings

Code Mapping Actions

Code Mapping Conditions

XAML mapping actions

XAML mapping conditions

Misc

Clone this wiki locally