Silverlight Business Application Template and Prism

Sep 9, 2012 at 7:54 PM

Are there some known issues with the use of Prism and the Silverlight Business Application Template?

Prism 4.1 + Silverlight 5

Sep 10, 2012 at 5:43 PM


So far I haven't seen any issues reported regarding this subject. Take into account that although this application was not created using Prism, I believe adding the Prism functionalities to it shouldn't require much effort.

For example as a starting point I would modify the Application_Startup method in the code behind of the App.xaml file and replace the call of the InitializeRootVisual method with the a call to initialize the bootstrapping process, for example like this:

private void Application_Startup(object sender, StartupEventArgs e)

        Bootstrapper bootstrapper = new Bootstrapper();
            // Show some UI to the user while LoadUser is in progress      

Then you could add the Bootstrapper class to the main application project, along with the corresponding references to the Prism required libraries, and in the override of the CreateShell method you could return the corresponding UIElement (e.g like in the aforementioned InitializeRootVisual method) that will be set as the RootVisual property of the application. For example the Boostrapper class could look like this:

public class Bootstrapper : UnityBootstrapper
        protected override DependencyObject CreateShell()
            BusinessApplication1.Controls.BusyIndicator busyIndicator = new BusinessApplication1.Controls.BusyIndicator();
            busyIndicator.Content = Container.Resolve<MainPage>();                    
            busyIndicator.HorizontalContentAlignment = HorizontalAlignment.Stretch;
            busyIndicator.VerticalContentAlignment = VerticalAlignment.Stretch;

            return busyIndicator;


        protected override void InitializeShell()

            Application.Current.RootVisual = (UIElement)this.Shell;

I hope you find this useful,

Agustin Adami

Sep 10, 2012 at 6:13 PM

And what about navigation?

Can I use Frame and Frame.UriMapper for navigation instead of the Prism Region Navigation?

Sep 10, 2012 at 7:46 PM


Based on my understanding, you should be able to use the approach that suits best to the requirements of your scenario, take into account that as mentioned in this section of the Prism documentation (Using the WPF and Silverlight Navigation Frameworks), region navigation was not designed to replace the Silverlight Navigation Framework. Instead, Prism region navigation was designed to be used side-by-side with the this framework. For example, it is common to use the Silverlight navigation framework to implement top-level navigation within the application's shell and then to use Prism regions to implement navigation within the rest of the application, this way you can take advantaje of the capabilities of each approach. However, take into account that as far as I know the Silverlight Frame Navigation doesn't allow navigating Prism regions and the Prism navigation API is not designed to work with frames as out of the box.

On the other hand, if your are interested on how to integrate Silverlight's Navigation Framework with Prism you could check the following articles from Karl Schifflett's blog:

I hope you find this handy,

Agustin Adami

Sep 13, 2012 at 6:04 PM

Thank you Agustin.