MessageService Show

Topics: Questions
Sep 9, 2014 at 10:04 AM
Hi.

How to Show a modal message in catel 4.0
var result = _messageService.Show("message", "title", MessageButton.YesNoCancel).Result;
Thats not working. I see no Dialog. And my application don't answers any more.
Sep 9, 2014 at 11:14 AM
See breaking changes section in docs.
Sep 9, 2014 at 11:52 AM
Sorry. Where. Jira? Codeplex?
Sep 9, 2014 at 12:17 PM
Sep 9, 2014 at 12:18 PM
Edited Sep 9, 2014 at 12:20 PM
Sorry
Sep 9, 2014 at 12:19 PM
Sep 9, 2014 at 1:01 PM
:-). Thanks

But I don't see anywhere the section "breaking changes". So I've you write "Update guides"...


I think I have an other failure.


I have override the Method Show in my own MessageService. Sorry


The only Thing I don't understand now. I get a warning of the Compiler:

warning CS4014: Because this call is not awaited, execution of the current method continues before the call is completed. Consider applying the 'await' operator to the result of the call.
Sep 9, 2014 at 1:04 PM
It's standard async/await stuff.

Decorate your method with async:

Previous:
public void MyMethod()
{
    if (_messageService.ShowMessage("bla") == MessageResult.Yes)
    {
        // check result
    }
}
New:
public async void MyMethod()
{
    if (await _messageService.ShowMessage("bla") == MessageResult.Yes)
    {
        // check result
    }
}
Now it won't block UI threads.
Sep 9, 2014 at 1:21 PM
It's standard async/await stuff.
First time I use.

But now I found the cause of the warning. It was an other place.

Thanks.