MessageService Show

Topics: Questions
Sep 9, 2014 at 9: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.
Coordinator
Sep 9, 2014 at 10:14 AM
See breaking changes section in docs.
Sep 9, 2014 at 10:52 AM
Sorry. Where. Jira? Codeplex?
Coordinator
Sep 9, 2014 at 11:17 AM
Sep 9, 2014 at 11:18 AM
Edited Sep 9, 2014 at 11:20 AM
Sorry
Coordinator
Sep 9, 2014 at 11:19 AM
Sep 9, 2014 at 12: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.
Coordinator
Sep 9, 2014 at 12: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 12: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.