Search code examples
wpfprismupdating

WPF InteractionRequest not working after Updating Prism 6.2.0 to 8.0


I have updated my WPF project build with Prism 6.2.0 to Prism 8.0. I am using .NET Framework 4.7.

I use InteractionRequest in a lot of places within my application in order to open a popup to gather user information. After updating the project, I get this error:

The type or namespace 'InteractionRequest<>' could not be found. Are you missing an assembly reference or a using directive?.

I have added the using Prism.Interactivity.

Does any one know how to fix this? Is InteractionRequest deprecated in Prism 8.0? And if it is, how do I substitute that functionality?


Solution

  • The InteractionRequest and PopupWindowAction API was replaced with a new dialog service in Prism 7.2.0.1367. The reasons for this are covered in the following GitHub issues:

    To quote Brian Lagunas the release notes:

    Currently, the only way to show any type of dialog with Prism is by using the PopupWindowAction in combination with System.Windows.Interactivity. [...] It's over complex, highly verbose, difficult to implement, and is very limited. [...]

    Instead, I created a new IDialogService API that will replace the PopupWindowAction altogether. This service will allow developers to show any dialog they want either modal, or non-modal, and have complete control over their dialog logic.

    You can refer to the dialog service documentation to learn how to use it and migrate. Please also note that Prism 8 adds support for multiple dialog window hosts, this is not supported in Prism 7.x.