private async void restartButton_Click(object sender, RoutedEventArgs e) { var dialog = new MessageDialog("Are you sure you want to restart the device?", "IoTHelpers"); dialog.Commands.Add(new UICommand("Yes", (cmd) => ShutdownManager.Restart())); dialog.Commands.Add(new UICommand("No")); dialog.CancelCommandIndex = 1; await dialog.ShowAsync(); }