private async void OnOpenDrive() { try { Reading = true; CdItems.Clear(); CdItemViewModel[] cdTracks = await _cdReaderService.GetTracks(DriveLetter); CdItems.AddRange(cdTracks); await RaisePropertyChanged(nameof(CdItems)); Reading = false; } catch (Exception) { _dialogService.ShowError(Resources.Error_CdRead); Reading = false; CdItems.Clear(); } finally { SelectAllCommand.RaiseCanExecuteChanged(); DeSelectAllCommand.RaiseCanExecuteChanged(); ReadCommand.RaiseCanExecuteChanged(); } }
/// <summary> /// 子供の検索(無駄にasync) /// </summary> private async void Search() { await _model.SearchChildDirectoryTaskAsync(); SelectAllCommand.RaiseCanExecuteChanged(); DeselectAllCommand.RaiseCanExecuteChanged(); }
private void OnCdItemsChanged(object sender, ListChangedEventArgs e) { SelectAllCommand.RaiseCanExecuteChanged(); DeSelectAllCommand.RaiseCanExecuteChanged(); ReadCommand.RaiseCanExecuteChanged(); }
private void RaiseCanExecuteChanged() { UpdateSelectedFilesCommand.RaiseCanExecuteChanged(); SelectAllCommand.RaiseCanExecuteChanged(); SelectNoneCommand.RaiseCanExecuteChanged(); }