Quantcast
Channel: patterns & practices: Prism
Viewing all articles
Browse latest Browse all 1878

New Post: Raised event of InteractionRequest becomes null

$
0
0
Hi,
I am working on WPF PRISM 5.0. I am using Popup of PRISM. I have done some customization in popup. I am facing one issue. I am using RequestNavigate to move from one user control to another.
So when I move from one user control to another, Raised event of InteractionRequest becomes null and popup doesn't open.

Below is some of the code snippet from my application.

UserControl1.xaml

<in:Interaction.Triggers>
<prism:InteractionRequestTrigger x:Uid="prism:InteractionRequestTrigger_1" SourceObject="{Binding ConfirmationRequest, Mode=OneWay}">
        <Popup:PopupWindowAction x:Uid="prism:PopupWindowAction_1" IsModal="True" CenterOverAssociatedObject="True" Width="350" Height="150">
        </Popup:PopupWindowAction>
    </prism:InteractionRequestTrigger>
</in:Interaction.Triggers>

ViewModel.cs

this.ConfirmationRequest = new InteractionRequest<PopupConfirmation>();

public InteractionRequest<PopupConfirmation> ConfirmationRequest { get; private set; }


this.ConfirmationRequest.Raise(
            new PopupConfirmation { Content = "Hi", Title = "Confirm" },
            OnConfirmation);

In the above code after navigate to other user control and coming back here, Raised event of this.ConfirmationRequest becomes null. It works everytime if I don't navigate to other user control.

Kindly help me what's the issue here.

Thanks,
Ayaz Shaikh

Viewing all articles
Browse latest Browse all 1878

Trending Articles



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