Skip to content

Commit

Permalink
Replied with a bool and not a Task<bool>
Browse files Browse the repository at this point in the history
  • Loading branch information
sonnemaf committed Nov 17, 2020
1 parent 4fcbc49 commit b8a4de5
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions MvvmDemoWpf/Recipients/AsyncYesNoMessageRecipient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,8 @@ namespace MvvmDemoWPF.Recipients {
class AsyncYesNoMessageRecipient : IRecipient<AsyncYesNoMessage> {

public void Receive(AsyncYesNoMessage message) {
Task<bool> GetResult() {
var result = MessageBox.Show(message.Text, "Confirm", MessageBoxButton.YesNo);
return Task.FromResult(result == MessageBoxResult.Yes);
}
message.Reply(GetResult());
var result = MessageBox.Show(message.Text, "Confirm", MessageBoxButton.YesNo);
message.Reply(result == MessageBoxResult.Yes);
}
}
}

0 comments on commit b8a4de5

Please sign in to comment.