SilverLight Prism

Hi Friends,

Can you please explain me  about SilverLight prism.
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

AshokSr. Software EngineerCommented:
Prism can be thought of as a set of libraries that help Silverlight applications be scalable and testable. It has a number of features (modularity, view regions and commanding) that help with this.
It shows how to use the bootstrappers, modules, catalogs, regions and commanding.

N_SriAuthor Commented:
Can any one still explain any more points...
I started off with prism recently and I've found that its super-awesome. Im my opinion starting Prism is kind of a pain as its a totally different approach to things if you're not aware of MVVM, but even if you are, its a pain getting to know all the library functions that Silverlight Prism provides.

First off, you need to get the code for the framework from Codeplex. (Just google it)

Secondly, you need to compile that code and get the libraries that it generates. (A bunch of DLLs that you need to add as a reference in your project).

First thing in Prism is, you override the normal way a silverlight application starts, from the App.xaml.cs, by providing a separate bootstrapper. In the bootstrapper, you define a set of modules, and the regions in which they need to be displayed.

A region is just like a ContentPlaceholder in A module in Prism is a separate project in Visual Studio. This is a completely independent Silverlight Application that will be placed in a region in your shell.

A shell is just like your master page in You create a basic layout and you define the regions in it. Generally the Shell and the Bootstrapper go in the same Silverlight Project.

In your modules, you create one or more Views. A view is what is going to be displayed to the client. This is where all your XAML goes. But the general code that goes in the code behind of a XAML file, now goes into a separate Class file which will be called a ViewModel. You link the ViewModel to the View by specifying the DataContext of the view (in its constructor in the code behind) to be the ViewModel. And ta-da you have a baby Prism project ready.

If you take the standard shop cart example, the basic design of the shop cart (visuals) will be in your shell. The Menu at the top can be a separate module. A login region on the side could be another module. The items to be displayed can be a separate modules. In the item display module, you can have two views - one for the list view, and one for an item's detailed view. The cart and the checkout system in itself can be another module. Modules in my perspective are parts of a system that are logically independent of the rest of the system.

Here's a link that should get you started on with Prism:

Another thing about prism: If you see a strange Error that prism is throwing, go into the innermost exception, or trace the error right from the start. There is always a very normal error in your code which gets bubbled through the Prism and  it ends up giving a crazy lookin error.

Now you should just get started with Prism with a tutorial or something, and follow the instructions by every step. That's the best way to get started. Once you have an application running, try to create an application of your own based on what you just learnt. This is when you start getting crazy errors and you start thinking about the architecture. That's what I did, and it worked well.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Development

From novice to tech pro — start learning today.