background preloader

Prism

Facebook Twitter

MVVM with Prism 101 – Part 1: The Bootstrapper. MVVM with Prism 101 – Part 1: The Bootstrapper Source Code I recently spoke at a CodeCamp put on by the Northern Utah .NET User Group (NUNUG) on implementing MVVM using Prism.

MVVM with Prism 101 – Part 1: The Bootstrapper

I hadn’t spoken in a long time and so I was over prepared – way over prepared. Then to top in off in my nervousness, I blew the whole presentation by starting 15 minutes late. I was the session after lunch and I assumed lunch was an hour, so I mistakenly assumed my session started at 1:00 PM. Embarrassing stories aside, I really learned a lot more about Prism and Silverlight and what an enterprise-class implementation of Prism looks like. Before I get started I would like to just make a short comment about MVVM. The View-Model is a composite of the abstraction of you view’s state and behavior. The reason for this and why it is possible has a strong tie to the way data biding works in WPF/Silverlight.

Once you get MVVM it will become second nature to you. Bootstrapper 5: bootstrapper.Run(); Setup ModuleCatalog. Prism for Silverlight/MEF Part 1 - Prism Modules. Download PrismTutorialSamples_PART1.zip - 286.62 KB Important Note Friends, I've noticed that the number of downloads for this article far exceeded the number of votes and bookmarks.

Prism for Silverlight/MEF Part 1 - Prism Modules

So please, if you use this tutorial and like it, vote for it. A bookmark won't hurt either Thanks. Introduction Microsoft Prism is a software framework whose purpose is to simplify building WPF and Silverlight applications. Prism (together with its source code, samples and documentation) can be downloaded from Prism on the CodePlex. Prism's main advantage lies in the fact that it allows building the WPF or Silverlight software as a set of almost independent modules that can be developed, tested and debugged separately and brought together by Prism framework to become one application. The importance of developing software as a number of independent modules cannot be overestimated. I hope that this tutorial will be set apart from other tutorials due to the following points: Overview of the Tutorial View Injection.

Prism for Silverlight/MEF Part 2 - Prism Navigation. Download PrismTutorialSamples_PART2.zip - 285.46 KB Introduction This is a Part 2 of Prism for Silverlight/MEF in Easy Samples Tutorial.

Prism for Silverlight/MEF Part 2 - Prism Navigation

Part 1 can be accessed at Prism for Silverlight/MEF in Easy Samples. Part 1 - Prism Modules and Part 3 - at Prism for Silverlight/MEF in Easy Samples. Part 3 - Communication between the Modules In this part, I cover Prism Region Navigation, which allows changing a view displayed or active within a Prism Region. Region navigation is essential for properly using the "real estate" of the application by changing the views displayed at different locations within the application screen depending on the current state of the application. Region Navigation functionality within Prism allows loading a view within a region based on the view's class name, passing navigation parameters, making decisions whether the view should be displayed or not, cancelling the navigation if needed and recording the navigation operations.

Prism for Silverlight/MEF Part 3 - Communication between the Modules. Download samples - Part 3 - 278.7 KB Introduction This is the 3rd (and last) part of "Prism for Silverlight/MEF in Easy Samples" Trilogy.

Prism for Silverlight/MEF Part 3 - Communication between the Modules

It describes communications between different modules within the application. Here are the pointers to Part 1: Prism Modules and Part 2: Prism Navigation. This part of the tutorial assumes some knowledge of C#, MEF and Silverlight as well as the concepts of Prism modules and regions which can be learned from parts 1 and 2 of this tutorial. As we learned in Part 1: Prism Modules, Prism modules are independently deployable software units (.dll files in WPF and .xap files in Silverlight). Communication between different modules is a little bit of a challenge since most modules do not reference each other (the independence condition) and thus cannot access each other's functionality directly. There are three ways for Prism modules to communicate between each other: Inter-Module Communications Overview and Samples Inter-Module Communications via a Service History.