Can't use StaticResource from App.xaml in sample

Topics: Prism v2 - WPF 3.5
Jun 23, 2010 at 4:18 AM

I based a prototype application on the DirectoryLookupModularity (http://www.global-webnet.net/blogengine/category/Prototype.aspx) which cost me a few hours of head-banging time - particularly when I tried to add a StaticResource for a new template I created.  Neither the Shell, nor any module, would except a static resource unless it was in the UserControl.Resources!  

I had actually searched for this StaticResource odd-ball behavior in this forum with no luck so perhaps this message will help the next person that bases a prototype off of this sample...

The problem: the App.xaml.cs code-behind file was launching the bootstrapper from the Constructor - not the OnStartup() method; this oversite doesn't permit you to use StaticResource during load - so you have to use DynamicResource.

Just downloaded PRISM 4 Drop 2.   Although I've been a hardcore Unity cronie since its conception I must admit I like what I'm seeing - my MVPVM prototype (above link) is in the process of being ported over....

 

Oct 4, 2010 at 9:43 PM

Hi,

Thanks for reporting that, as you mentioned it might help to other users with similar scenarios.

Fernando Antivero
http://blogs.southworks.net/fantivero