Create and apply reusable assets

Expression Studio 2.0
This page applies to WPF projects only

You can reuse a brush or other property value by converting it to a resource and applying it to another property. This is useful if you want to create and reuse a set of colors or other values that will define the unique look of your application.

  1. Click the Selection Cc296401.2ff91340-477e-4efa-a0f7-af20851e4daa(en-us,Expression.10).png tool, and then on the artboard, hold the CTRL key while you drag your rectangle to create a copy.


    You can also copy and paste using the usual keyboard shortcuts CTRL+C and CTRL+V, or by using the items on the Edit menu. Notice that the second rectangle appears to be in front of the first. This is because of the stacking order of objects.

  2. With the second rectangle selected, click the Fill property under Brushes in the Properties panel. At the bottom of the Brushes window, click the Convert brush to resource Cc296401.c6247e94-077c-40e1-8979-7886a2eaa8ef(en-us,Expression.10).png button. The Create Brush Resource dialog box appears.


    The Name field is the resource key. The Define in field determines the scope where you want your resource defined. With This document selected, the resource will be available only to objects that are contained in this document. If you select the Application scope, this resource will be available to all the documents in your application, but not to other projects. If you define your brush in a new resource dictionary, you can always add the resource dictionary to other projects so that your brush resource can be used in those projects. It is by defining multiple resources in a single dictionary that you can ensure a common look between applications.

  3. Click the New button. The New Item dialog box appears. You can leave the fields as they are and click OK.


    A new resource dictionary is created and visible in the Project tab. You are returned to the Create Brush Resource dialog box.

  4. Your new resource dictionary is now selected, so click OK to create the new brush resource.

  5. Click the Resources tab, expand the node for your resource dictionary, and then click on the drop-down arrow next to your brush resource. The color editor opens so that you can modify your brush resource. Change the purple gradient stop to yellow.


    Your brush resource can be applied to any brush property of any object.

  6. Select your other rectangle, and then in the Properties panel, click the Advanced property options Cc296401.d6ba8f4a-b8a2-445a-af0b-a267dfade6e1(en-us,Expression.10).png marker beside the Fill property.


    A drop-down menu appears.

  7. From the drop-down menu, click Local Resource, and then select Brush1. Your brush resource is now applied to both rectangles.


    If you change your brush resource in the Resources panel again, the changes will be reflected on both rectangles.

Next steps

Community Additions