Posts Tagged ‘Resource’

Static and Dynamic XAML Resources

To assign a style to a control in WPF (or Silverlight) you can use Dynamic or Static markup extension. According to MDSN Article the differences are:

The StaticResource Markup Extension processes a key by looking up the value for that key in all available resource dictionaries. This happens during loading, which is the point in time when the loading process needs to assign the property value that takes the static resource reference. The DynamicResource Markup Extension instead processes a key by creating an expression, and that expression remains unevaluated until the application is actually run, at which time the expression is evaluated and provides a value.

Categories: WPF Tags: , , ,