Question

Would anybody know how do I give the focus to the Cancel button of a Prism InteractionRequest?

What happens at the moment, is that given you've pressed enter on a button in a main window and the InteractionRequestTrigger fired, if you press enter again, you are in trouble as the focus stayed on the parent window and InteractionRequestTrigger fires a second time...

Thanks for your help

Was it helpful?

Solution 2

Ah! I should have marked my Popup as Focusable!

OTHER TIPS

Focus on Confirmation dialog should be set automatically after firing the InteractionRequestTrigger.

You may find helpful the following State-Based Navigation Prism Quickstart:

A Raise() method is invoked in the QuickStart for showing the InteractionRequest's dialog at ChatViewModel's SendMessage() method by setting the proper ViewModel context and its callback:

public IInteractionRequest SendMessageRequest
{
    get { return this.sendMessageRequest; }
}

public void SendMessage()
{
    var contact = this.CurrentContact;
    this.sendMessageRequest.Raise(
        new SendMessageViewModel(contact, this),
        sendMessage =>
        {
            if (sendMessage.Result.HasValue && sendMessage.Result.Value)
            {
                this.SendingMessage = true;

                this.chatService.SendMessage(
                    contact,
                    sendMessage.Message,
                    result =>
                    {
                        this.SendingMessage = false;
                    });
            }
        });
}

In addition, the ChatView detects the interaction request and the PopupChildWindowAction displays the SendMessageChildWindow pop-up window:

<prism:InteractionRequestTrigger SourceObject="{Binding SendMessageRequest}">
    <prism:PopupChildWindowAction>
        <prism:PopupChildWindowAction.ChildWindow>
            <vs:SendMessageChildWindow/>
        </prism:PopupChildWindowAction.ChildWindow>
    </prism:PopupChildWindowAction>
</prism:InteractionRequestTrigger>

I hope this helps.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top