I just started playing with the CompositeWPF library, and so far it seems really powerfull. However I got this issue while trying to fast without RFTM'ing ;)
I created a new Shell project, just like described in the help file, with a ShellWindow and Bootstrapper. However I defined my Shell with the following XAML:
1 <Window x:Class="Shell.ShellWindow"
If you now run the application, it compiles perfectly however, on startup vshost.exe crashes, with an internal error as follows:
DEBUG: Configuring container. Priority: Low. Timestamp:2009-02-23 00:20:29Z.
DEBUG: Configuring region adapters. Priority: Low. Timestamp:2009-02-23 00:20:29Z.
DEBUG: Creating shell. Priority: Low. Timestamp:2009-02-23 00:20:30Z.
A first chance exception of type 'System.Collections.Generic.KeyNotFoundException' occurred in Microsoft.Practices.Composite.Presentation.dll
A first chance exception of type 'Microsoft.Practices.Composite.Presentation.Regions.Behaviors.RegionCreationException' occurred in Microsoft.Practices.Composite.Presentation.dll
It took me a while to figure the following out:
To create a region, you need to add the RegionManager.RegionName property in XAML to a
ContentControl-based UI element or an ItemsControl-based UI element that has built-in support in the Composite Application Library.
Maybe this behaviour is intentional but I think it's more friendly to throw an exception telling me I'm trying to doing something stupid :)