You can define resources using either XAML or code. The two types of resources are static resources and dynamic resources.
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. ...