Types of Resources

You can define resources using either XAML or code. The two types of resources are static resources and dynamic resources.

Static Resources

Supported By

WPF

Yes

Silverlight

Yes

A static resource is resolved at compile time, after which the XAML processor assigns it to a property while the XAML loads, which occurs before the application runs. The term StaticResource references a static resource in XAML and includes the key that uniquely identifies the resource. StaticResource is a markup extension, which is a placeholder to resolve a property at runtime. Chapter 4, covers markup extensions in detail.

After a property obtains a value through a StaticResource markup extension, any changes made later to the resource dictionary are ignored. ...

Get XAML Developer Reference now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.