<Setter Property="PropertyBeingSet" TargetName="{x:Type NameOfTheTarget}" Value="ValueBeingSet"|{"DynamicResource ResourceName"} | {"StaticResource ResourceName"} /> <Setter .../> defines a property for a specific element. It is used to apply a Style or trigger to multiple elements of a specific type, e.g., all Buttons, all TextBlocks, etc. The element declares the attribute (property) to be set, the target element type, and the value to which to set the attribute. For example, Setter could be used to set the Background of all Button elements to a specific Color (Example 10-2) or to set the width of all Button elements to the same size (Example 10-3). Attributes
Example 10-4. Example of setting the TargetName of the Setter to a child node
|