private void RefreshCommands() { AddCommand.RaiseCanExecuteChanged(); MoveUpCommand.RaiseCanExecuteChanged(); MoveDownCommand.RaiseCanExecuteChanged(); DeleteCommand.RaiseCanExecuteChanged(); DeleteAllCommand.RaiseCanExecuteChanged(); }
private async Task DeleteAllModel() { var dialogres = Xceed.Wpf.Toolkit.MessageBox.Show("Delete all entries?", "Delete entries", MessageBoxButton.YesNo); if (dialogres == System.Windows.MessageBoxResult.Yes) { _busyIndicator.Busy = true; await ServiceClient <IDeveloperService> .ExecuteAsync(o => o.DeleteAllAsync()); Developers = new ObservableCollection <IDeveloper>(); DeleteAllCommand.RaiseCanExecuteChanged(); _busyIndicator.Busy = false; } }
private void UsersSavedCallback(string payload, string severity) { var models = JsonConvert.DeserializeObject <IEnumerable <DeveloperModel> >(payload); if (models == null) { return; } _busyIndicator.Busy = true; var list = Developers.ToList(); list.AddRange(models); Developers = new ObservableCollection <IDeveloper>(list); DeleteAllCommand.RaiseCanExecuteChanged(); _busyIndicator.Busy = false; }
private async Task LoadData() { _busyIndicator.Busy = true; await Task.Delay(500); //var developerSvc = new DeveloperService(); //var items = await developerSvc.FindAllAsync(); var developers = await ServiceClient <IDeveloperService> .ExecuteAsync(o => o.FindAllAsync()); Developers = new ObservableCollection <IDeveloper>(developers); DeleteAllCommand.RaiseCanExecuteChanged(); _busyIndicator.Busy = false; }
private async Task <bool> DeleteModel(DeveloperModel entity) { var result = false; var dialogres = Xceed.Wpf.Toolkit.MessageBox.Show("Delete the selected entity?", "Delete entity", MessageBoxButton.YesNo); if (dialogres == System.Windows.MessageBoxResult.Yes) { _busyIndicator.Busy = true; result = await ServiceClient <IDeveloperService> .ExecuteAsync(o => o.DeleteAsync(entity)); if (result) { Developers.Remove(entity); _eventAggregator.GetEvent <EntityEditPubEvent>().Publish(new DeveloperModel()); } _busyIndicator.Busy = false; } DeleteAllCommand.RaiseCanExecuteChanged(); return(result); }