Prism & Silverlight: Part 10 - A Larger Example - "Email Client"

Play Prism & Silverlight: Part 10 - A Larger Example - "Email Client"

The Discussion

  • User profile image

    It seems that all iPod versions of the videos in this series are copies of the first part ...

  • User profile image
    Kevin Nixon

    This is the good stuff.  I've previously used Prism in conjunction with Unity to create composite WPF clients in this manner, but it's useful to see a run through of the whole process (disclaimer .. I watched the first 40 minutes or so .. will continue with it tonight).  It's tackled at a refreshingly rapid pace whilst remaining clear and entirely comprehensible too.  Bravo.


    (Apologies .. I added this comment to the Part 1 comments section .. it was supposed to be here)

  • User profile image

    Thanks Kevin - glad you're finding it useful. To be honest, my original intent was that this would last around 30 minutes but it took me a good 2 hours to get to the point where I'd actually got something done which covered the various things I wanted to try and get in.


    I hope the rest of your watching goes as well as the first half Smiley

  • User profile image

    A really excellent set of videos Mike. I signed-up just to say that!

  • User profile image

    Thanks Pete - glad to have you signed up and thanks for the feedback.

  • User profile image

    Hi Mike


    Great videos!


    I tried downloading Part 1-10 in iPod format. It seems that they are all copies of Part 1 :/


  • User profile image

    Hi, I keep getting "Media Failure" errors when watching in Silverlight. If I right click and "Save Target As" on the WMV it downloads about 10% then I get a "Connection was closed remotely" error. I'm in the UK if that has any relevance - perhaps this needs a mirror copy?

  • User profile image
    Garth Henderson

    Hiya Mike,


    Really a wonderful set of videos.  I'm on the other side of the world in Hawaii.


    I am also having Part 10 give me a media error about 85% of the way through.



  • User profile image

    Apologies if you're seeing media errors - I'll ping the Channel9 guys and see if there's something we can do here. I'll also download the video again myself and see if I see the same problem.

  • User profile image

    Hi Mike,


    At around 30 minues you go and create your own commands for ListBoxSelectionChanged and TreeViewSelectionChanged - what are your opinions on using, for example, a TwoWay Binding to the ListBox SelectedItem property to the view model instead and then publish the event in the Setter?  Not such a nice solution perhaps but possibly easier in many of these cases.  Here's what I did for the MailListViewModel which seems to work fine:


    Adding a binding as follows:

    <ListBox SelectedItem="{Binding SelectedItem, Mode=TwoWay}"
    ItemsSource="{Binding Emails}">


    Then had the following property on the view model:


    private object _selectedItem=null; 
    public object SelectedItem { 
       get { return _selectedItem; } 
       set { 
            _selectedItem = value; 
            EmailSelectionChangedEvent evt = eventAggregator.GetEvent<EmailSelectionChangedEvent>();
            MailViewModel viewModel = (MailViewModel)value; 
            evt.Publish(viewModel == null ? null : viewModel.Email); 


    Can you see any problems with this approach?

  • User profile image

    One other thought - you use converters in some of the views - I know that some MVVM guys think that you should never need a converter in the View since the ViewModel should prepare the data correctly for it.  I also know there are lots of discussions about MVVM currently and nothing really baked into the framework or tools to answer all the current questions - but just wondered what your opinion was.


    Fantastic set of videos by the way - really detailed and incredibly useful - many thanks for the work you have put into them; I for one really appreciate the hands-on "live code" approach that you take...





  • User profile image

    Hi Ian,


    Nice to hear from you ( and see you briefly at the StackOverflow day the other week Smiley ). I agree that creating the custom command here did a feel bit heavy handed as it's quite a lot of code for what you get out of it although it does keep that separation very "pure". Someone dropped me a mail saying "What if I used Expression's behavior library for that?" which seemed like another approach and you have another one here  which seems pretty reasonable to me ( and a lot less code Smiley ).





  • User profile image

    Nice screencasts, very well explained, a great start to learn how to use Prism and Unity.



    Is it possible to have the code source from all samples, like you did for the last sample?

    (In order to play with).



  • User profile image
    Beat Kiener

    Hi Mike


    It's very easy to learn Prism with your screencasts. Thank you very much.


    Do you plan to add a part 11, about the topic unit testing? Currently, I'm not sure how to unit tests the different assemblies from the email client. Do I need a bootstrapper in my unit test method and the region manager stuff to get it run for the unit testing?


    Thanks in advance,

    Beat Kiener

  • User profile image

    You've made it much easier for me to understand the concepts because of the attention to detail that goes into them, also how each video builds upon the previous one in the series. Only feedback would be to include either the source or configuration files at the least as it can be a bit tricky to read them from the video.


    Thanks Mike!

  • User profile image


               I have gone through the video you have mentioned.

               Although many doubt regarding EventAggregator, UnityContainer, RegionManager where solved. But I am failed to get a Answer Regarding:

            In my project I have  to Navigate as if   "Shell"    conatin two region ToolBar +( (Common Module(LoginViews))--------> Module A or Module B or Module C)


            Here "Common Module" Can be Considered as "login module". After login the user will choose the application namely "Module A" or "Module B" or  "Module c".     Each module as number of  "sub-Module" say "View"s Expect  for "login Module" .Please help with an Idea.


           my  shell .Xaml code:

    <UserControl x:Class="Forte.UI.Shell.Page"
        <Grid x:Name="LayoutRoot" HorizontalAlignment="Center" ShowGridLines="False">
                <RowDefinition Height="Auto"/>
           <ItemsControl x:Name="MainToolbarRegion"
                         Regions:RegionManager.RegionName="MainToolbarRegion"/> --------------->This region contains "Menu"  it will not change   

            <Grid Margin="5,135,5,0" HorizontalAlignment="Center" VerticalAlignment="Center">     
                <controls:ClippingBorder x:Name="MainRegion"              ---------->This region load all module's view at present
                                         BorderThickness="0" CornerRadius="10" ClipContent="True"


  • User profile image

    Hi Mike,


    First of all, This is a great series post, I must say.


    I am sure by now you are moved on to lot of new stuff like Silverlight 4 etc.


    I have seen this series of posts and its immensely useful for someone to start getting insight into PRISM framework.

    in my new project, I am trying to use PRSIM framework and want to have multi platform application.. ( that's the goal )


    I was wondering, If you can post this application or parts of last series of smaller posts which shows "Test Driven Development using PRISM" , "Test first" approach.


    That will give even more idea for new people trying to learn PRSIM, what to test and what not to test.


    your comments are welcome.


    Hope that would be possible.




  • User profile image

    Thanks for the great videos Mike - they removed the final hurdle to my adoption of Prism!


    Imagine my disappointment though when, at about 123 minutes of the last video, I got a "media failed" error ... oh well, at least I have the source code :/


    Maybe the wmv or whatever could be made downloadable?


    Anyways, really enjoys the series and got a lot out of it - cheers!

  • User profile image

    kurtmang - the video should be downloadable? try the little windows icon near to the "media downloads" text - that should let you download the video and pick up from where it failed for you ( apologies for that - I've no idea why the streaming version is failing here ).



  • User profile image

    Thanks Mike - didn't see that!

  • User profile image

    Great Video Mike,


    I followed through using VB and duplicated your efforts. It's starting to make sense for me now.



  • User profile image

    Just... Thank you!


    This one is particulary great. The presentation is really good. I hope we'll got more and more Tongue Out

  • User profile image

    I don't have words to tell how great it is!! Amazing videos. These videos is the best tutorial I have ever seen.

    Mike thank you very much for this amazing job!


  • User profile image

    Hii Mike,


     I am  a beginner in Silverlight & Prism. I saw this vedio and i learned some concepts. I ve ended up with few questions..

    You have created many projects like "EmailEntities,EmailInterfaces,EmailService,MailListUI,MailReadingUI,MailSelectionUI,NewMailUI,



    They are all related to UI  email functionalities. As a beginner, My questions are


    1. What is presentation pattern you have used in this sample..

         Pls explain me what are all the Models , Views , Presenters stuff used in the solution.. ?

    2. which class acts like a View , Model & Presenter ?

    3.If at all i need to include Database stuff(reading messages from DB) , I assume i need to have 2 other projects namely domain layer, infrastructure layer. In this context,  should the Model communicates Or View communicates Or Presenter communicates with the domain layer ?


    4. If i have domain & infrastructure layer, does it make sense to maintain the "PresentationUtility" project inside the infrastructure layer..?


    These are my fundamental questions awaiting your esteemed reply.






  • User profile image

    Hi Mike. Thanks for the great set of videos. You are a fantastic tutor.

  • User profile image
    Joe Kahl

    Mike,  Thank you for sharing.  You've done a great job of putting this technology together for us from the ground up.  I am finding your videos very helpful.  I have had the infamous "Part 10 Media Failure at 85%" twice in a row.  I would like to watch the entire Part 10 video.  Please try publishing the video again.  Joe


    So, the next day, from work, on a different computer I was able to watch the whole video.

  • User profile image
    Joe Kahl

    Mike,  I have downloaded your EmailClient solution.  I was able to get it to build after I built my own Prism assemblies.  When I run the app not much happens.  I get a blank browser.  You never mentioned the startup project.  From the video it looks to be the EmailClient.Web.  And with that selected my local web server starts up.  But there is nothing in the browser.  Here is the URL being opened:  http://localhost:51319/EmailClient.Web/  I have break points in the shell and bootstrapper, but they do not get called.  What have I missed?  Joe

  • User profile image

    Amazing tutorials Mike, thanks for sharing your technical expertise. I am new to SL and PRISM, but I found it really easy to understand and its very comprehensive. Kudos to you for such dedication.

  • User profile image

    Great video, has really helped me understand unity/prism better so I can decide how best to use it in my projects.


    Maybe minor question but in all your View's you always set the DataContext in a lamda which fires on the FrameworkElement.Loaded event.


    Is there a case when deferring this assignment until the Loaded event is better than just assigning immediately in the class constructor?


  • User profile image

    those tutorials were awsome,it was verrrrrrrrrrrrrrrrrrrrrrrrrrrry helpufil 4 me,thanks

  • User profile image

    It is most appresiaeted. I wonder if the devoleping team did se this. This is how it is done.

    Start with .. and then .. wonderfull.

    Now a days - Include the Wcf Ria Services with Prism - And show the last (show 10) again. Now ther is commands & behaviors.

    The one I want most, is how to use it on Model first approach. It seems to me using the model first approach, dictate a wrong way to use Prism 4 and Ria services?

    Is it Poco's or somthing else that is the starting point?


  • User profile image

    Mike, thank you very much for these great videos! You've really produced the best training material I've seen so far! Andreas

  • User profile image

    For anyone who is remotely considering PRISM, I highly recommend that you watch all ten of Mikes videos, you will not be disappointed.
    I recently started to dig deeper into the adoption of PRISM 4.0 and prior to watching these videos I thought I truely understood all that I needed to get started, but truthfully I am so much further ahead as a result of  taking the time to watch all ten of these very well presented video tutorials.
    Mike does a fantastic job of articulating a good portion of what you need to know in order to roll with PRISM.
    Thanks Mike, job well done!

  • User profile image

    I really appreciated the videos and found them very useful. However, I converted the video 10 code to run with PRISM 4 but I also got the same problem that Joe  Kahl described above. Has anyone gotten this application to run using PRISM 4? It would be instructive for me if I can get it to run and use the debugger and see how PRISM/Unity are working.
    Thank you,Peter

  • User profile image
  • User profile image

    Excellent post Mike! Keep the good work...

  • User profile image

    Excellent post Mike! Keep up the good work...

  • User profile image

    Hello Mike!
    I love your videos, I feel I got much wiser after watching this series.

    I think it would be a great thing if you could add videos about the other features of Prism 4.0 (navigation etc.)

    Also, I wish you could extend this series so that after watched and studied, user should be able to build a robust Silverlight LoB application, using other related features of Silverlight and its relatives, such as WCF RIA Services, Entity Framework, and patters like Repository, DAL and more.
    The final idea is to teach users how to create a real-life end-to-end LoB application using the most efficient available ways and technologies.


Add Your 2 Cents