/// <summary> /// 下载文件 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void Load(object sender, RoutedEventArgs e) { ObservableCollection <FileEntity> fileList = fileListbox.ItemsSource as ObservableCollection <FileEntity>; if (fileList != null) { foreach (var fileEntity in fileList) { if (fileEntity.IsFile && fileEntity.IsChecked) { long fileSize = 1; long.TryParse(fileEntity.FileSize, out fileSize); //未拿到文件长度的,之后要进行特殊处理 _detailViewModel.Load(fileEntity.FileId, fileEntity.FileName, fileSize); } } } }