Prism4 CTP and Dave Hill's Prism Application Template

Topics: Prism v4 - Silverlight 4
Aug 12, 2010 at 9:47 PM
Edited Aug 12, 2010 at 9:56 PM

If you prefer Dave Hill's Prism Application Template over the Modularity QuickStarts project with Prism4 CTP then a few tweaks are needed:

1) Change the Prism libraries from 2.2 to 4.0 CTP versions

2) The bootstrapper changes because the old GetModuleCatalog() has been changed to CreateModuleCatalog, a full referrence to CreateFromXaml is required.

The Old

protected override IModuleCatalog GetModuleCatalog() becomes:

protected override IModuleCatalog CreateModuleCatalog( ) 
return Microsoft.Practices.Composite.Modularity.ModuleCatalog.CreateFromXaml( new Uri("/Shell;component/ModuleCatalog.xaml", UriKind.Relative)); 

4)  Make sure TryResolve() and not Resolve() is used to create the ShellView from the bootstrapper


        protected override DependencyObject CreateShell( )
            // Use the container to create an instance of the shell.
            ShellView view = Container.TryResolve();

            // Set it as the root visual for the application.
            Application.Current.RootVisual = view;

            return view;

3) Make sure your web project setting are done as usual (set as start up, set SL applications to all 3 modules)

4) F5