Loading user information from Channel 9

Something went wrong getting user information from Channel 9

Latest Achievement:

Loading user information from MSDN

Something went wrong getting user information from MSDN

Visual Studio Achievements

Latest Achievement:

Loading Visual Studio Achievements

Something went wrong getting the Visual Studio Achievements

Prism & Silverlight: Part 6 - Shells, Regions, Views

35 minutes, 49 seconds


Right click “Save as…”

This is part 6 of a series of screencasts illustrating some of the ideas found in "Prism" or the "Composite Application Guidance" from the Patterns and Practices team that can be used to build Silverlight applications in a way that lends itself to testability and modularity.

In talking to customers building business applications with Silverlight I find that Prism (and it's friend Unity) is frequently mentioned but not everyone has seen it and so I thought I would explore it myself and capture some of the results of that exploration here.

We start off with some fairly basic code which we move towards making use of dependency injection and modularity;

and then we move that code into the Silverlight world and try to illustrate some specific areas of Prism;

and then finally we try and bring some of these concepts together in a longer, more realistic example of a simple Email application built using the Prism framework - warning, this is a much longer session but I wanted something that draws things together;

The recommendation would be that you watch the 10 screencasts in order but if that feels like too long a process or if you're already very familiar with concepts like dependency injection and containers like Unity then perhaps watch the last screencast first and then refer back to the previous screencasts if certain areas need more illumination.

I put the source code for Video 10 here for download as it's a bigger set of source and something you might want to explore after the video - this does not necessarily represent "best practise" but is, instead, just meant to illustrate some of the Prism ideas.


Follow the discussion

  • Oops, something didn't work.

    Getting subscription
    Subscribe to this conversation
  • ItayItay

    Hi Mike,
    can you please publish the version of the prism library this code was written for?

  • At the 28 minute mark, Mike describes code where neither the View creates the ViewModel nor vice-versa.  Here is some code you could add to your module definition (or other appropriate place for doing your region manager work) to do so.

    Private Sub RegisterViewWithRegion(Of ViewType As UserControl, ViewModelType)(ByVal regionName As String)
        Dim viewModel = _container.Resolve(Of ViewModelType)()
        Dim view = _container.Resolve(Of ViewType)()
        view.DataContext = viewModel
        _regionManager.RegisterViewWithRegion(regionName, Function() view)
    End Sub

Remove this comment

Remove this thread


Comments closed

Comments have been closed since this content was published more than 30 days ago, but if you'd like to continue the conversation, please create a new thread in our Forums, or Contact Us and let us know.