5 Jun
2009

BSDG – PRISM/MVVM for WPF Presentation Sample Code

Category:UncategorizedTag: , , , , , , :

As promised, I am posting the sample code I covered in the presentation for everyone to download and start playing with.  If you have any questions or would like me to discuss a specific aspect in more detail just drop me a line.

Download the Presentation Source.  This contains the all sample code that I discussed during the presentation.

Useful links:

10 thoughts on “BSDG – PRISM/MVVM for WPF Presentation Sample Code

  1. Thanks for the talk example code. Another question for you: you showed off a listbox-like control you wrote, do you follow the MVVM pattern for controls like that as well, or is that just for more ‘region like’ things?

  2. @Tony Rasa

    It really depends on the control you are creating. Most of the time you will not implement a MV-(whatever) pattern for control development. WPF controls are mainly made up of Dependenct Properties, but if you have a complex control I don’t see why you couldn’t use a pattern.

  3. @Syed

    The sample code for the presentation can be downloaded from the link in the blog post. If you are refering to a powerpoint, this presentation does not have a powerpoint presentation.

  4. @Brian Lagunas
    Hi Thanks for your reply I am in debate to know why in this code we have interface defined dor views and Presenter Model what are the advantages we can do it with concrete class why is this necessary in this example and what are the advantages?

  5. @Brian Lagunas
    Hi Brian!
    Ignore my previous question I re write it again.
    In this source code I found the view and presenter model both have Interface defined I know this is benefinial if we working out in Tier programming but I couldn’t understand the advantages of using this approach in MVVM concept I also cheked some codes examples from codeplex even they don’t used it. It might be some understanding I am missing here that is why I am asking you this question what are the benefits we can get to use Interface with view and model or what will be harm if we don’t have interface here.
    I hope this is better explained.
    Thanks

  6. @Syed

    This presentation covered both PRISM and MVVM, so the code is showing the MVVM implementation using the PRISM framework. The reason interfaces were used in both the ViewModel and the View is because we are using an IOC container to resolve them. This is just one way to implement the MVVM pattern. Of course there are many other variations. You just have to pick the one that works best for your situation.

  7. I am currently following your code example to make my Prism/MVVM app. Currently I have three different modules out of which one would show up on the “DisplayMainRegion” at any given time. All three modules are however loaded through the AddModule() command. Now there is a corresponding toolbar button for each Module. Upon clicking the toolbar button I activate the module and it shows up on the MainRegion.
    My question is that should we use Composite commands to do such an operation, when we are switching between modules, or should we have another layer such as a ModuleManager that would activate views?

  8. @Farhan Asad

    I would recommend using the commanding. The module that registers for the command should be responsible for showing itself. Each module should be dumb to any other module and have no dependencies of other modules.

Comments are closed.