-
Notifications
You must be signed in to change notification settings - Fork 5
Writing conditional Xaml Mappings
ldfallas edited this page Aug 17, 2015
·
2 revisions
Mapping actions for Xaml documents can be applied conditionally. Each action has a property which is the condition it need to meet before applying any action.
For example the following Xaml property mapping will remove the FontFamily property from an element if the current property uses the PhoneFontFamilyNormal
static resource.
...
<xmap:XamlMap Kind="Property" PropertyName="FontFamily" >
<xmap:XamlMap.Action>
<xmap:RemoveAttribute>
<xmap:RemoveAttribute.Condition>
<xmap:PropertyUsesStaticResource PropertyName="FontFamily"
StaticResourceName="PhoneFontFamilyNormal" />
</xmap:RemoveAttribute.Condition>
</xmap:RemoveAttribute>
</xmap:XamlMap.Action>
</xmap:XamlMap>
...
In this case we used the Condition property of the Xaml mapping actions.
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