Apply or remove a resource
To apply a resource to an object or property
In the Objects and Timeline panel, select the object that you want to apply a resource to.
Do one of the following:
Apply a resource to a property In the Properties panel, click Advanced options next to the property, point to Local Resource or System Resource, and then click an available resource from the list that appears.
If you do not see a resource that you expect, it might be because the types of the resources do not match. If you do not want to choose one of the available resources, you can come back to this step after you either create a new resource or create a value converter to convert the resource you want to the data type that you need.
For more information, see Create a resource and Create, export, or import a resource dictionary.
Apply a style or template resource to a control Select a control object under Objects and Timeline. On the Object menu, point to Edit Style or Edit Template, point to Apply Resource, and then click the name of the template from the list that appears.
If you know that a control template exists for your control, but the Apply Resource item is not enabled under Edit Template, try the Apply Resource item under Edit Style. Control templates that you create in Blend for Visual Studio 2012 are wrapped in style resources in order to make them easier to manage.
Apply any resource to any object Drag a resource from the Resources panel onto an object on the artboard. A pop-up window appears that displays a list of properties to which you can apply the resource.
[!참고]
Resources can be applied wherever they're compatible. For example, a brush resource can be applied to the Foreground property of a TextBox object.
To remove a resource from an object or property
Under Objects and Timeline, select the object that you want to remove a resource from.
Do one of the following:
Reset a property to its default value Click Advanced options next to the property in the Properties panel, and then click Reset from the list that appears.
Copy the value of the resource to a property and break the reference link Click Advanced options next to the property in the Properties panel, and then click Convert to Local Value from the list that appears.
Assign another resource or value to a property or object Follow the steps that you would typically follow to set the property or template.
The link to the previous resource will be replaced with the new setting.
[!참고]
Removing a resource from an object or property does not delete the resource from your project.
For more information, see Delete a resource.
To view the resources that are applied to an object
Select an object on the artboard or in the Objects and Timeline panel.
In the Resources panel, click Show resources used by selected element .
The object name appears in the Resources panel. Expand the node to view the list of resources that are applied to the object. You can select other objects to view the resources that are applied to those objects.
팁 Remember to click Show all resources when you want to return to the list of all resources.