-
Notifications
You must be signed in to change notification settings - Fork 5
SetPropertyValueToSimpleValue Xaml Mapping Action
ldfallas edited this page Aug 31, 2015
·
3 revisions
Sets the value of a string property on the current element.
| Property | Usage | Description |
|---|---|---|
| NewPropertyValue | Required | The string value to set. |
| AttributeToChangeName | Optional | The name of the attribute to set the value to |
| AttributeToChangeNamespace | Optional | The namespace of the attribute to set the value to |
Say that we want to set the Background property to Transparent to grids having Page as its parent. We can write the following mapping:
<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="Grid" ElementNamespace="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
<xmap:XamlElementMapper.Maps>
...
<xmap:XamlMap Kind="Element">
<xmap:XamlMap.Action>
<xmap:SetPropertyValueToSimpleValue AttributeToChangeName="Background" NewPropertyValue="{ThemeResource ApplicationPageBackgroundThemeBrush}">
<xmap:SetPropertyValueToSimpleValue.Condition>
<xmap:ElementParent ParentElementName="Page" ParentElementNamespace="http://schemas.microsoft.com/winfx/2006/xaml/presentation" />
</xmap:SetPropertyValueToSimpleValue.Condition>
</xmap:SetPropertyValueToSimpleValue>
</xmap:XamlMap.Action>
</xmap:XamlMap>
</xmap:XamlElementMapper.Maps>
...
</xmap:XamlElementMapper>
</MapUnit.Elements>
</MapUnit>- Variables bound using the [BindPropertyValueElement Xaml Mapping Action](BindPropertyValueElement Xaml Mapping Action) could also be used as the value of
NewPropertyValue
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