public async Task AddAsync() { var command = new Command(); command.Keys.Add(new SingleKey(string.Empty)); command.Lines.Add(new SingleCommand(string.Empty)); var viewModel = new CommandSettingsViewModel(command); var result = await this.ShowDialogAsync(viewModel); if (result != true) { return; } UserCommands.Add(new UserCommandViewModel(command)); foreach (var key in command.Keys) { StorageService[key.Text] = command; } }