DynamicResource styles are not loaded at all


Since I started using CODE framework, I was unable to have a designer time view of the XAML files.

For all styles related to CODE framework I get the similar error in XAML Designer:
The resource "CODE.Framework-Layout-ListPrimarySecondaryFormLayout" could not be resolved.
I attached a screenshot of the XAML designer. It's very annoying not to see the real render of the view. I have to run the app after each change to see the result. Please help.

file attachments

Closed Oct 25, 2015 at 7:46 PM by MarkusEgger


MarkusEgger wrote Oct 25, 2015 at 7:45 PM

Yes, that is by design. DynamicResources are loaded at runtime and on an as-needed basis. This is what provides the framework the incredible theme switching and code reuse power. But it means that during design time, unless you do something special, you will not see these resources.

Is this a big deal? We don't think so. Views are so simple most of the time, that visual design is not very helpful, and it in fact has a tendency to pollute the view with auto-generated code. Visual design is very useful on the other hand when you design the individual resource dictionary. Great care has been taken to make sure that the resource dictionaries can be opened in tools like Blend. I think that is much more important.

So when I say "unless you do something special", what do I mean by that? Well, you can use the "design time resources" feature that adds links to resource dictionaries you intend to use at design time. (Of course it may still look different during runtime, if you happen to be loading different resources dynamically). This is not a CODE Framework feature as such. Instead, it is just a feature supported by tools such as Blend and VS. If you just google that term, you will find good instructions on that.


wrote Oct 25, 2015 at 7:46 PM

wrote Oct 25, 2015 at 7:46 PM