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
17
votes
3 answers

Efficient communication between two .Net applications

I am currently writing a .Net application in c#, which has two main components: DataGenerator -a component generating a lot of data Viewer - a WPF application that is able to visualize the data that the generator creates Those two components are…
Christian
  • 4,345
  • 5
  • 42
  • 71
17
votes
3 answers

Resolving classes without registering them using Castle Windsor

Take the following useless program: class Program { static void Main(string[] args) { IUnityContainer unityContainer = new UnityContainer(); IWindsorContainer windsorContainer = new WindsorContainer(); Program…
James Thurley
  • 2,650
  • 26
  • 38
17
votes
3 answers

How to debug Unity resolution?

In a WPF project(with prism) we are using Unity as DI framework. Recently, after we merged two big branches, we were not able to start our application, we were having StackOverflowException. Due to the nature of the exception, we were not able to…
J4N
  • 19,480
  • 39
  • 187
  • 340
17
votes
3 answers

How do I test Prism event aggregator subscriptions, on the UIThread?

I have a class, that subscribes to an event via PRISMs event aggregator. As it is somewhat hard to mock the event aggregator as noted here, I just instantiate a real one and pass it to the system under test. In my test I then publish the event via…
Thorsten Lorenz
  • 11,781
  • 8
  • 52
  • 62
16
votes
4 answers

Composite Guidance for WPF : MVVM vs MVP

I am confused. Maybe you can help me :) I have been following the guidance of CAG and found the MVP pattern very natural to me. Suppose I have a UI-ready Model (for example : implements INotifyPropertyChanged), I use the presenter to bind this Model…
ArielBH
  • 1,991
  • 3
  • 22
  • 38
16
votes
2 answers

Unable to cast object of type 'MS.Internal.NamedObject' to custom type

I am not new to WPF, but I can't figure out this problem: I use an ObservableCollection that i bind to ComboBoxes, it's all working great as usual, but at some point i need to change the content of the collection (i retrieve a new set…
Louis Kottmann
  • 16,268
  • 4
  • 64
  • 88
16
votes
3 answers

WPF Prism - What is the point of using Prism Regions?

I'm just wondering what the point of regions are. I guess I don't understand the problem they solve. For example, I see a lot of people using regions for a navigation region, but then why not just have an ItemsControl bound to an…
michael
  • 14,844
  • 28
  • 89
  • 177
16
votes
4 answers

Best logging approach for composite app?

I am creating a Composite WPF (Prism) app with several different projects (Shell, modules, and so on). I am getting ready to implement logging, using Log4Net. It seems there are two ways to set up the logging: Let the Shell project do all of the…
David Veeneman
  • 18,912
  • 32
  • 122
  • 187
16
votes
2 answers

PRISM and WCF - Do they play nice?

Ok, this is a more general "ugly critters in the corner" question. I am planning to start a project on WCF and PRISM. I have been playing around with PRISM some time know, and must say, I like it. Solid foundation for applications with nice…
Christian Ruppert
  • 3,749
  • 5
  • 47
  • 72
16
votes
3 answers

How to Unit Test DelegateCommand that calls async methods in MVVM

I am new to Unit Testing MVVM and using PRISM on my project. I am implementing Unit Testing on our current project and not having luck finding resources online that would tell me how totest DelegateCommand that calls async method. This is a follow…
Jepoy_D_Learner
  • 435
  • 1
  • 6
  • 13
16
votes
4 answers

Why should I use Prism?

I am interested in making a decent WPF application which will be pretty huge. Someone suggested using PRISM which we are currently looking into. We might be using the MVVM pattern to implement this application. I saw some PRISM screencasts and it…
azamsharp
  • 19,710
  • 36
  • 144
  • 222
14
votes
4 answers

Problems understanding use of MVVM when using WCF DTO's in a WPF smart client app

Having very little experience in the area I am writing a WPF smart client app communicating to a WCF backend using MVVM and am really struggling to make the right decisions out of all the information out there. Which leads me to a set of questions…
lostinwpf
  • 633
  • 2
  • 9
  • 29
14
votes
1 answer

Should a View bind indirectly to properties in a Model in MVVM?

Let's say I've got a View. It's DataContext is bound to a ViewModel and the ViewModel exposes a Model property. Is it MVVMlike to bind fields in the View to properties in the Model (e.g. Binding Path=Model.FirstName)? Should the Model implement…
Steve Dunn
  • 21,044
  • 11
  • 62
  • 87
14
votes
4 answers

MEF keeps reference of NonShared IDisposable parts, not allowing them to be collected by GC

I've encountered somewhat of a problem in MEF's part lifetime which causes memory leaks in my Prism application. My application exports views and viewmodels with the PartCreationPolicy being set to CreationPolicy.NonShared. The views and viewmodels…
Adi Lester
  • 24,731
  • 12
  • 95
  • 110
14
votes
3 answers

CanExecute Logic for DelegateCommand

Update: The focus became MVVM instead of the actual question so I'm updating it. I'm having a problem with CanExecute for DelegateCommand. It doesn't update before I call RaiseCanExecuteChanged, is this the desired behavior? I uploaded a simple…
Fredrik Hedblad
  • 83,499
  • 23
  • 264
  • 266