/// <summary> /// Method to invoke when the AddTab command is executed. /// </summary> private void OnAddTabExecute() { var vm = new CreateTabWindowViewModel(); if (_uiVisualizerService.ShowDialog(vm) ?? false) { _tabService.AddTab(vm.CloseWhenUnloaded); } }
/// <summary> /// Method to invoke when the AddTab command is executed. /// </summary> private async Task OnAddTabExecuteAsync() { var vm = new CreateTabWindowViewModel(); if (await _uiVisualizerService.ShowDialogAsync(vm) ?? false) { _tabService.AddTab(vm.CloseWhenUnloaded); } }
public async Task <IActionResult> CreateTab([FromBody] TabCreateViewModel tabCreateVM) { try { var tab = new Tab() { Creator = tabCreateVM.Creator, Name = tabCreateVM.Name, Tempo = tabCreateVM.Tempo, GuitarType = (InstrumentType)tabCreateVM.Type, Iterations = tabCreateVM.iterations }; await _tabService.AddTab(tab); return(Ok(tab)); } catch (Exception ex) { // return error message if there was an exception return(BadRequest(ex.Message)); } }