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
12
votes
1 answer

How to Mock ILogger / ILoggerService using Moq

I'm writing some unit tests for my View Model class. The constructor of this class is injected with an ILoggerService. This interface defines 1 method GetLog which returns an ILogger. Something like below where this represents a class that…
user630190
  • 1,142
  • 2
  • 11
  • 26
12
votes
1 answer

Prism assembly reference failure: System.Windows.Interactivity

I have C#/WPF Prism (v4.0) app that has a persistent problem loading/resolving the System.Windows.Interactivity dll that comes with the Prism library. I've been working for three days straight trying to debug/solve this problem. I've learned a ton…
Ryan Norbauer
  • 1,718
  • 2
  • 17
  • 26
12
votes
2 answers

Referencing the correct System.Windows.Interactivity dll from Prism application

I have a WPF Prism application that I'm building. The application is to the point where I want to be able to add EventTriggers to controls so I can call commands on the underlying view model. However, I can't seem to reference the correct DLLs…
Josh
  • 10,352
  • 12
  • 58
  • 109
12
votes
2 answers

Unable to consolidate NuGet package transitive dependency versions in two NET Standard projects

Adding EF Core to a NET Standard project introduces transitive dependency versions incompatible with NuGet packages in other projects I have a solution with multiple .NET Standard 2.0 projects. One Project A uses the Google.Protobuf (3.11.2) NuGet…
Jinjinov
  • 2,554
  • 4
  • 26
  • 45
12
votes
2 answers

Porting a Prism-based WPF application to .NET Core

We have a Prism-based WPF application with over 10 man years of development invested in it. We are moving big chunks of it into web browser control hosted modules to make it platform independent in the future. There seems to be no UI framework to…
Ranjith Venkatesh
  • 1,322
  • 3
  • 20
  • 57
12
votes
2 answers

Publish an Event without PayLoad in Prism EventAggregator?

Why can't we Publish Events without any PayLoad. _eventAggregator.GetEvent().Publish(new SelectFolderEventCriteria() { }); Now, I don't need any pay load to be passed here. But the EventAggregator implementation mandates me…
Horizon
  • 291
  • 4
  • 14
12
votes
2 answers

Why implement an interface on viewmodel and view in mvvm

I am quite new to MVVM pattern so please bear with me. I have seen implemnentations in wpf +mvvm + prism where all the views tend to have an IView as top most interface. Then the views in the respective modules have a view specific interface like…
Hari Subramaniam
  • 1,814
  • 5
  • 26
  • 46
12
votes
3 answers

WPF, Prism v2, Region in a modal dialog, add region in code behind

I have a composite WPF application. In one of my modules I want to make a wizard and have the steps show up in a region so I can switch between the steps easier. Originally I had this wizard showing up in a tab region and the nested region worked…
Shaboboo
  • 1,347
  • 1
  • 16
  • 35
11
votes
5 answers

WPF Application Errors and .Net Framework Repairs

Background: I have a .Net 3.5 WPF "Prism"-based application running on Windows XP and Windows PosReady 2009 PCs. The app runs on PCs that are shut down every night (via a C# call to "shutdown.exe") and booted fresh in the morning (via Wake-on-LAN).…
Lee Roth
  • 228
  • 1
  • 11
11
votes
1 answer

Prism, connecting Views and ViewModels with Unity, trying to understand it

Creating the View and View Model Using Unity Using Unity as your dependency injection container is similar to using MEF, and both property-based and constructor-based injection are supported. The principal difference is that the types are…
Jim_CS
  • 4,082
  • 13
  • 44
  • 80
11
votes
1 answer

CompositeWPF: EventAggregator - when to use?

I've been looking in to the Composite Application Library, and it's great, but I'm having trouble deciding when to use the EventAggregator... or rather - when NOT to use it. Looking at the StockTraderRI example, I'm even more confused. They are…
toxvaerd
  • 3,622
  • 3
  • 24
  • 29
11
votes
1 answer

WPF GetIsInDesignMode From Inside A Converter

How would i be able to use the GetIsInDesignMode from inside a converter? It seems that the method requires the parent user control/window, a variable which is not accessible when inside a converter. Example : public class CellImageConverter :…
OrPaz
  • 1,065
  • 11
  • 25
11
votes
1 answer

Prism 4 ILoggerFacade for Log4Net?

I am converting from Prism 2.1 to Prism 4, and I need to write an ILoggerFacade class for Log4Net. My old code from Prism 2.1 no longer works. Does anyone have sample code for an ILoggerFacade class they'd be willing to share? Thanks for your help.
David Veeneman
  • 18,912
  • 32
  • 122
  • 187
11
votes
1 answer

Wpf Observable collection and DataGrid not updating changes

I have an observable collection in the view model that implements Bindable Base as follows Please have a look at the MoveUp and MoveDown methods where they are bound to two buttons in the view. When ever up button is pressed I want the selected row…
nikhil
  • 1,578
  • 3
  • 23
  • 52
11
votes
1 answer

Can't navigate from inside a callback method with Prism

I have a small application using WPF and Prism. I have my shell and two modules. I can successfully navigate between them in the "normal fashion" (e.g from a button click) so I know they are wired up for navigation correctly. However, if I…
LonghornTaco
  • 452
  • 2
  • 14