public async Task InitializeAsync() { if (_settingsService.IsFirstRun) { var commands = new List <UICommand> { new UICommand("I'm Good"), new UICommand("Open Settings", async(cmd) => await _userInterfaceService.ShowSettingsAsync()) }; await _userInterfaceService.ShowDialogAsync("Well Hello!", "It looks like this is the first time you've run this app so let's make sure things are setup correctly. We have preconfigured this app's connection to your Windows IoT device using the default device name (minwinpc), username (administrator), and password (p@ssw0rd). If you have changed any of those settings on your device you will need to change this app's settings too.", commands, 1); _settingsService.IsFirstRun = false; } // first run? }
public async Task TerminateProcesAsync(int processId) { var process = ProcessesModel.FirstOrDefault(p => p.ProcessId == processId); var commands = new List <UICommand> { new UICommand("Yes, kill it", async(cmd) => { try { await _restService.DeleteAsync(new Uri(String.Format("api/taskmanager/process?pid={0}", processId), UriKind.Relative)); ProcessesModel.Remove(process); } catch (Exception ex) { await _userInterfaceService.ShowFeedbackAsync(ex); } }), new UICommand("No, be nice") }; await _userInterfaceService.ShowDialogAsync("Terminate Process Confirmation", String.Format("Are you sure you want to terminate the '{0}' process?", process.ImageName), commands, 1); }