-
Notifications
You must be signed in to change notification settings - Fork 5
WrapContent Xaml Mapping Action
ldfallas edited this page Aug 17, 2015
·
2 revisions
Generates a wrapper element for the content of the current element.
Property | Usage | Description |
---|---|---|
WrappingElementName | Required | The name of the wrapper element to be generated |
WrappingElementNamespace | Required | The xml/xaml namespace of the element being generated |
Say that we will convert from PanoramaItem
in WP8 to HubSection
in UWP.
For example this Windows Phone 8 Silverlight code:
<phone:PanoramaItem>
<TextBlock>Hello!</TextBlock>
</phone:PanoramaItem>
We want to convert the previous code the following UWP code:
<HubSection>
<DataTemplate>
<TextBlock>Hello!</TextBlock>
</DataTemplate>
</HubSection>
We can use the WrapContent
action as follows:
<xmap:XamlElementMapper ElementName="PanoramaItem"
ElementNamespace="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone">
<xmap:XamlElementMapper.Maps>
<xmap:XamlMap Kind="Element">
<xmap:XamlMap.Action>
<xmap:RenameElement NewName="HubSection" NewNamespace="http://schemas.microsoft.com/winfx/2006/xaml/presentation" />
</xmap:XamlMap.Action>
</xmap:XamlMap>
<xmap:XamlMap Kind="Element">
<xmap:XamlMap.Action>
<xmap:WrapContent
WrappingElementName="DataTemplate"
WrappingElementNamespace="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
/>
</xmap:XamlMap.Action>
</xmap:XamlMap>
</xmap:XamlElementMapper.Maps>
...
</xmap:XamlElementMapper>
- The wrapper will not wrap the properties that use element style setters
Contact us for more information
Overview
Writing mappings
Code Mapping Actions
- ActionSequence
- AddHelper
- AddNamespaceImport
- AddPreStatementFromTemplate
- CommentOut
- Conditional
- Keep Code Mapping Action
- MarkAsNotMapped
- RedirectCall
- RedirectCallToInnerMember
- RedirectIndexer
- RedirectProperty
- RemoveCurrentStatement
- RemoveParameter
- ReplaceClassUsage
- ReplaceMethodBodyWithTemplate
- ReplaceParameterDeclarationType
- ReplaceParameterMember
- ReplaceParameterValue
- ReplaceWithMethodCall
- ReplaceWithProperty
- ReplaceWithTemplate
Code Mapping Conditions
- AllConditionsApply
- ArgumentCount
- AssignName
- AssignNameToArgumentRange
- IsExpressionOfType
- IsStringLiteralMatchingRegex
- WithArgument
- WithAssignment
- WithAssignmentLeftSide
- WithAssignmentRightSide
- WithCalledMemberOwner
- WithCalledMethodExpression
- WithConstructorCall
- WithLambdaExpressionBody
- WithLambdaExpressionParameter
- WithLeftSideOfDottedAccess
- WithMemberInitValue
- WithMethodCall
XAML mapping actions
- ActionSequence
- AddStatementToConstructorFromTemplate
- BindPropertyValueElement Xaml mapping action
- ChangeEventHandlerEventArgsType
- CommentOutElement
- CommentOutProperty
- MarkAsNotMapped
- MoveValueToContentProperty
- RemoveNamespaceDeclaration
- RenameElement
- RenameProperty
- ReplaceAttributeValue
- ReplaceEventHandlerBodyWithTemplate
- ReplaceEventHandlerParameterMember
- ReplaceNamespaceDeclaration
- ReplacePropertyValueWithParentResource
- ReplaceStaticResourceWithThemeResource
- SetPropertyValueToComplexElement
- SetPropertyValueToSimpleValue
- WrapContent
XAML mapping conditions
Misc