I want to use StaticResource in the root element of a xaml document. But MSDN says:
Static resource references from within a resource dictionary must reference a resource that has already been defined lexically before the resource reference. Forward references cannot be resolved by a static resource reference.
And this:
The lookup process then traverses the logical tree upward, to the parent element and its resource dictionary. This continues until the root element is reached.
Should I define my resource in the application or create it from code?