Skip to content

ReplaceStaticResourceWithThemeResource Xaml Mapping Action

ldfallas edited this page Aug 17, 2015 · 2 revisions

Description

Replaces a StaticResource usage with a ThemeResource usage on a property value.

This mapping action verifies that the current value of the property is a reference of the specified StaticResource.

Static resources are commonly used to refer to predefined theme resources. For example:

<Border Fill="{StaticResource PhoneAccentBrush}">...</Border>

In this case if we want to change from PhoneAccentBrush to SystemColorControlAccentBrush we can write:

<xmap:ReplaceStaticResourceWithThemeResource
         NewThemeResourceName="SystemColorControlAccentBrush"
         OldStaticResourceName="PhoneAccentBrush" />

Properties

​Property ​Usage ​Description
​OldStaticResourceName ​Required The name of the static resource currently used by the current property value. If the current property value doesn't use this static resource, this mapping action will not change the target.
​​NewThemeResourceName ​Required ​The name of the ThemeResource to generate

Example

TODO

Notes

TODO

Overview

Writing mappings

Code Mapping Actions

Code Mapping Conditions

XAML mapping actions

XAML mapping conditions

Misc

Clone this wiki locally