While I was working on a universal app I wanted to display a simple message dialog. So I started typing:
So I figured a namespace was missing in the code. Therefore I let Resharper fix it for me. After pressing alt-enter I saw that resharper couldn’t help me with it. So I figured something else must be wrong here. The correct solution was the following:
var dialog =
MessageDialog(“Are you sure you wanna do something?”, “Delete something”);
UICommand(“Yes”, (command => ViewModel.DeleteSomethingCommand.Execute(null))));
I create a dialog with a title and a message and I’ve added two commands to it. The cancel command does nothing in this case. The “Yes” command triggers a command in my viewmodel. You can also set the default command index but because my cancel command is the first command that was added to the collection this is the correct command in my case.