Quantcast
Channel: Windows Presentation Foundation (WPF) forum
Viewing all articles
Browse latest Browse all 18858

Prism InteractionRequest PopupView

$
0
0

Hi All,

We have a requirement to customize the content and buttons for a confirmation dialog.

We're using Prism 5.0, and would like very much to go with the Interactivity facility provided as per the sample below, since it seems like the most natural approach:

https://msdn.microsoft.com/en-us/library/ff921081(v=pandp.40).aspx

My question is, in the ItemSelectionView.xaml, how do we bind to Content? We'd like to avoid creating multiple custom views displaying different messages (of course ;)). We can bind to Content via Notifications and Confirmations, as shown in the RaiseNotification, RaiseConfirmation and RaiseCustomPopupView functions in InteractionRequestViewModel.cs (which, unfortunately, only provides OK/Cancel buttons), however, our users are asking for other buttons, such as Yes/No, etc., with different button content)

For example, in InteractionRequestViewModel.cs:

        private void RaiseItemSelection()
        {
            // Here we have a custom implementation of INotification which allows us to pass custom data in the 
            // parameter of the interaction request. In this case, we are passing a list of items.
            ItemSelectionNotification notification = new ItemSelectionNotification();
            notification.Items.Add("Item1");
            ...
            notification.Title = "Items";
            notification.Content = "Some Content"; // <--- set custom content here
            // The custom popup view in this case has its own view model which implements the IInteractionRequestAware interface
            // therefore, its Notification property will be automatically populated with this notification by the PopupWindowAction.
            // Like this that view model is able to recieve data from this one without knowing each other.
           ...

Thanks very much for your help!


Viewing all articles
Browse latest Browse all 18858

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>