private async void DeleteExecute(object obj) { if (SelectedConnection != null) { if (SelectedConnection.Id == 0) { SideBar.RemoveEmptyItems(); SideBar.SelectedItem = SideBar.Items.FirstOrDefault(); Notify(nameof(SideBar)); } else { var result = await _connectionService.DeleteAsync(SelectedConnection.Id); if (!result.Succeed) { await ShowMessage(result.ErrorMessage); } else { LoadControl(null); } } SaveCommand.NotifyCanExecuteChanged(); } }