views:

59

answers:

1

Hi everyone! To realize my application I have used a lot Blend3. When Blend3 wants to link a resource to another resource, it uses many times the link-type "DynamicResource". As I have understood (but I could have understood not well), the "Dynamic" links have sense only if I want to modify the links at runtime. In other cases they use more memory in vain. I don't want to modify anything at runtime, then the question is: have sense to replace "DynamicResource" with "StaticResource" in all my application? Thank you! Pileggi

+2  A: 

Blend works better in design time with DynamicResource. See:

http://blogs.msdn.com/b/unnir/archive/2009/03/31/blend-wpf-and-resource-references.aspx

The money quote from that:

a) Should I use Static or Dynamic resource lookup?

Blend def. plays better with dynamic resource lookups. You could use a static resource lookup as long as the resource was not located or merged into App.xaml. People have raised concerns around performance issues with dynamic resource lookups (you pay for what you get). While that might be true, an interesting data point is that the Expression Blend source code uses a ton uses dynamic resource lookups for our own UI (of course, we too use static resource lookups in places where the resource would never change, or where it not possible to use a dynamic resource extension, for example non-DPs).

John Gardner
Thank you very much!As Ian Oakes says in his post in the thread linked above by John Bowen, I found some errors at design time (also with the Visual Studio designer) when I have tried to replace "DynemicResource" with "StaticResource" in a usercontrol. I have decided to leave the Blend XAML code.
pileggi