Tuesday, 18 February 2014

InteractionRequest: the focus stays on the clicked button

Focus on Confirmation dialog should be set automatically after firing the InteractionRequestTrigger.
You may find helpful the following State-Based Navigation Prism Quickstart:
Raise() method is invoked in the QuickStart for showing the InteractionRequest's dialog atChatViewModel'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 PopupChildWindowActiondisplays the SendMessageChildWindow pop-up window:
<prism:InteractionRequestTrigger SourceObject="{Binding SendMessageRequest}">
    <prism:PopupChildWindowAction>
        <prism:PopupChildWindowAction.ChildWindow>
            <vs:SendMessageChildWindow/>
        </prism:PopupChildWindowAction.ChildWindow>
    </prism:PopupChildWindowAction>
</prism:InteractionRequestTrigger>

No comments:

Post a Comment