Questions tagged [prism]

Prism is a framework for building loosely coupled, maintainable, and testable XAML applications in WPF, Windows 10 UWP, and Xamarin Forms.

Prism is an open source framework for building loosely coupled, maintainable, and testable XAML applications in WPF, Windows 10 UWP, and Xamarin Forms.

Prism provides an implementation of a collection of design patterns that are helpful in writing well-structured and maintainable XAML applications, including MVVM, dependency injection, commands, event aggregation, and others.

Prism's core functionality is a shared code base in a Portable Class Library targeting these platforms. Those things that need to be platform specific are implemented in the respective libraries for the target platform.

Prism also provides great integration of these patterns with the target platform. For example, Prism for UWP and Xamarin Forms allows you to use an abstraction for navigation that is unit testable, but that layers on top of the platform concepts and APIs for navigation so that you can fully leverage what the platform itself has to offer, but done in the MVVM way.

For more information visit the project site https://github.com/PrismLibrary/Prism.

You can find the latest documentation here.

Samples

Some samples for using Prism with WPF, UWP and Xamarin Forms can be found here:

WPF

UWP

Xamarin Forms

4433 questions
20
votes
2 answers

Run-time registration with Autofac

While discussing Autofac with a colleague, the issue of run-time registration of dependencies arose. In Prism, for instance, assemblies are frequently loaded at run time and their dependencies registered with the IoC container (usually Unity). How…
Daniel Miller
  • 331
  • 1
  • 2
  • 9
20
votes
2 answers

How to do multiple shells in my Prism app (like MS Office)?

I try to create an application that has a window behaviour as MS Office, for example Word/Excel. The user opens the application and when clicking new, a completely new window shall appear with the look of the application. The closest that I found so…
ps23
  • 339
  • 1
  • 4
  • 11
20
votes
10 answers

Sync SelectedItems in a muliselect listbox with a collection in ViewModel

I have a multi-select listbox in a SL3 app using prism and I need a collection in my viewmodel that contains the currently selected items in the listbox. The viewmodel doesn't know anything about the view so it does not have access to the listbox…
MIantosca
  • 833
  • 1
  • 10
  • 33
20
votes
9 answers

Passing state of WPF ValidationRule to View Model in MVVM

I am stuck in a seemingly common requirement. I have a WPF Prism (for MVVM) application. My model implements the IDataErrorInfo for validation. The IDataErrorInfo works great for non-numeric properties. However, for numeric properties, if the user…
Jatin
  • 4,023
  • 10
  • 60
  • 107
19
votes
3 answers

Change the project type from class library to WPF User control library

While setting up my Prism WPF solution I had added a project as Class library. Just realized I want it as a WPF user control library to add resource dictionaries and other WPF related stuff. Is there a way to convert my class library project to WPF…
ioWint
  • 1,609
  • 3
  • 16
  • 34
19
votes
1 answer

Prism 4: RequestNavigate() not working

I am building a demo app to learn the navigation features of Prism 4. The app has two modules--each one has three Views: A UserControl with a text block ("Welcome to Module A") A RibbonTab (using a Region Adapter), and An Outlook-style Task Button…
David Veeneman
  • 18,912
  • 32
  • 122
  • 187
19
votes
1 answer

Alternatives to Prism + MEF for modular MVVM apps

My team and I are beginning to plan the development of a modular application which will likely multi-target WPF & Silverlight. I personally have some experience using the older version of PRISM to build a composite Silverlight app using the MVVM…
Steve Brouillard
  • 3,256
  • 5
  • 41
  • 60
19
votes
2 answers

Prism Event Aggregation - subscriber not triggered

I'm working on implementing an event aggregation with Prism. I have a few modules, and I want each of them to subscribe to events that tells them when they are requested. I started out doing an all plain example with both subscribed and publisher in…
stiank81
  • 25,418
  • 43
  • 131
  • 202
19
votes
1 answer

How does Prism compare with Caliburn?

Looking at the Prism and Caliburn frameworks as a WPF newbie, what are their relative strengths and weaknesses?
Sean Kearon
  • 10,987
  • 13
  • 77
  • 93
18
votes
1 answer

How to invoke a method on the UI thread from within a worker thread?

I'm working on a project which uses the following technologies: C# (.NET 4.0) WCF PRISM 4 I'm currently making an asynchronous call to one of our Web Services using the Begin/End methods generated by a proxy. The call is successful and the client…
Hussein Khalil
  • 1,585
  • 2
  • 25
  • 47
18
votes
4 answers

How to get the current active view in a region using PRISM?

I know that i can get all the registered views in a region with : var vs = mRegionManager.Regions[RegionNames.MainRegionStatic].Views.ToList(); and i can see there is the following code…
Ehsan Zargar Ershadi
  • 24,115
  • 17
  • 65
  • 95
18
votes
4 answers

What does this mean in Prism/Unity: Container.Resolve()

(from the StockTraderRIBootstrapper.cs file in the Prism V2 StockTrader example app) What is the difference between this: ShellPresenter presenter = new ShellPresenter(); and this: ShellPresenter presenter = Container.Resolve(); I…
Edward Tanguay
  • 189,012
  • 314
  • 712
  • 1,047
18
votes
4 answers

The "pretty" way to make a modal dialog in WPF with Prism and MVVM Pattern

yesterday i used google to find a few ways to make an awesome reusable modal dialog in WPF with PRISM 4.1 and the MVVM pattern. I found some examples but i must say non of those were as "pretty" as i liked them to be. This one: WPF Modal Dialog (no…
darkdog
  • 3,805
  • 7
  • 37
  • 47
18
votes
4 answers

MEF vs. PRISM. What is the difference? What will be supported in the future?

What I want to create is a Silverlight app with a few tabs/modules that will all be separate DLLs. I see PRISM has the Shell/Module concepts that seem directed towards doing UI and I find a nice demo (showing how to search digg/twitter). But it…
punkouter
  • 5,170
  • 15
  • 71
  • 116
17
votes
3 answers

WPF Prism - Where to put Resources?

I have a prism application and various modules. I am wondering where is the best place to locate resources such as styles, brush, controltemplates, datatemplates? Should I make one single resource dictionary and put everything there? Should each…
Jim_CS
  • 4,082
  • 13
  • 44
  • 80