PopUps With Interactivity Using ConfirmationRequest (Prism 5.0)

In continuation of my previous article on PopUps with Interactivity, here we will see how to implement an IConfirmation request. To make this article short, I'll implement an IConfirmation request on top of the previous example.

Step 1

Let's open our viewModel and add a property for the InteractionRequest of type IConfirmation as:

  1. public InteractionRequest<IConfirmation> ConfirmationRequest { getset; }  
Step 2
Now for every getter/setter we should have a corresponding command, that will help us in invoking this request:
  1. public ICommand ConfirmationCommand { getset; }  
Step 3
 
Just like NotificationRequest, we need to create instances of these objects in the constructor as:

NotificationRequest

If you look at the preceding snippet closely, you will notice that in the case of Confirmation, we are handling Status in a slightly different manner.

Step 4
 
The next step is to update our View as we did for NotificationRequest.

update our View

Step 5
 
Now everything is in place. Let's quickly run the application and click on the PopUp button:

popup

Based on user's choice, whether OK or Cancel button is clicked, a status message will be displayed as shown:

confirmed