#552 – Setting a Property to Use an Existing Resource
May 7, 2012 Leave a comment
You can use Blend to create resources for objects (e.g. brushes) that you want to use in several places in your user interface. Once you’ve defined a resource, you can use it as a value for a property on a control.
Let’s say that you’ve defined several resources within the resource dictionary for a Window. Below, we’ve defined a couple linear gradient brushes and a couple solid color brushes.
Now let’s say that you’re trying to pick a brush to use for the Background property of a Button. You can select the Button and then find its Background property on the properties panel.
Now set the Background to use an existing resource by clicking on the small square at the right side of the property and selecting a resource from the Local Resource submenu. Under this menu, you’ll see all of your resources listed.