Questions tagged [staticresource]

StaticResource refers to a Xaml Markup Extension implemented as part of the Windows Presentation Foundation (WPF) Resource Model.

The Windows Presentation Foundation (WPF) provides a mechanism for referencing objects that are shared across modules, or used to enhance one or more framework elements.

Static resources are used to refer to objects or values that have been previously defined in the Xaml object graph. Each static resource is identified by a key, and the key must conform to the Xaml Name Grammar specification

This tag is appropriate for questions that involve the StaticResource markup extension or its syntax; however, the use of other tags may be more appropriate and attract a broader audience. Alternate tags are: Data Templates, Control Templates, Style, Data Context, ObjectDataProvider plus other tags that convey a focus on Xaml technology.

249 questions
39
votes
1 answer

How to bind to a StaticResource with a Converter?

I want to use a Converter to change the value of a StaticResource before assigning it to a property. Is there a way to simulate a Binding that will just set the value of the StaticResource after converting it? Something like {Binding…
Ignacio Soler Garcia
  • 21,122
  • 31
  • 128
  • 207
27
votes
2 answers

Set an image as a Button's content in style

I have a WPF button defined like this: