diff --git a/Correlator/ViewModels/PictureFileViewModel.cs b/Correlator/ViewModels/PictureFileViewModel.cs index 792d6b8..afd3dea 100644 --- a/Correlator/ViewModels/PictureFileViewModel.cs +++ b/Correlator/ViewModels/PictureFileViewModel.cs @@ -62,9 +62,8 @@ public DelegateCommand GoBackCommand { get; set; } public DelegateCommand ItemSelectedCommand { get; set; } - public DelegateCommand ShowPictureCommand { get; set; } - public DelegateCommand DeleteItemCommand { get; set; } - public DelegateCommand ReLoadDataCommand { get; set; } + public DelegateCommand ShowPictureCommand { get; set; } + public DelegateCommand DeletePictureCommand { get; set; } public DelegateCommand> PageUpdatedCmd { get; set; } #endregion @@ -83,13 +82,26 @@ _selectedFile = (ImageResultFile)dataGrid.SelectedItem; }); - ShowPictureCommand = new DelegateCommand(delegate(string fullPath) + ShowPictureCommand = new DelegateCommand(delegate { + if (_selectedFile == null) + { + dialogService.ShowDialog( + "AlertMessageDialog", + new DialogParameters + { + { "AlertType", AlertType.Error }, { "Title", "温馨提示" }, { "Message", "图片文件路径错误,无法查看" } + }, + delegate { } + ); + return; + } + dialogService.ShowDialog("BigPictureView", - new DialogParameters { { "ImageFullPath", fullPath } }, delegate { }); + new DialogParameters { { "ImageFullPath", _selectedFile.FullPath } }, delegate { }); }); - DeleteItemCommand = new DelegateCommand(() => + DeletePictureCommand = new DelegateCommand(() => { if (_selectedFile == null) { @@ -112,8 +124,6 @@ } }); - ReLoadDataCommand = new DelegateCommand(() => { Growl.Success("刷新成功"); }); - PageUpdatedCmd = new DelegateCommand>(args => { PictureFiles = _totalFiles diff --git a/Correlator/ViewModels/PictureFileViewModel.cs b/Correlator/ViewModels/PictureFileViewModel.cs index 792d6b8..afd3dea 100644 --- a/Correlator/ViewModels/PictureFileViewModel.cs +++ b/Correlator/ViewModels/PictureFileViewModel.cs @@ -62,9 +62,8 @@ public DelegateCommand GoBackCommand { get; set; } public DelegateCommand ItemSelectedCommand { get; set; } - public DelegateCommand ShowPictureCommand { get; set; } - public DelegateCommand DeleteItemCommand { get; set; } - public DelegateCommand ReLoadDataCommand { get; set; } + public DelegateCommand ShowPictureCommand { get; set; } + public DelegateCommand DeletePictureCommand { get; set; } public DelegateCommand> PageUpdatedCmd { get; set; } #endregion @@ -83,13 +82,26 @@ _selectedFile = (ImageResultFile)dataGrid.SelectedItem; }); - ShowPictureCommand = new DelegateCommand(delegate(string fullPath) + ShowPictureCommand = new DelegateCommand(delegate { + if (_selectedFile == null) + { + dialogService.ShowDialog( + "AlertMessageDialog", + new DialogParameters + { + { "AlertType", AlertType.Error }, { "Title", "温馨提示" }, { "Message", "图片文件路径错误,无法查看" } + }, + delegate { } + ); + return; + } + dialogService.ShowDialog("BigPictureView", - new DialogParameters { { "ImageFullPath", fullPath } }, delegate { }); + new DialogParameters { { "ImageFullPath", _selectedFile.FullPath } }, delegate { }); }); - DeleteItemCommand = new DelegateCommand(() => + DeletePictureCommand = new DelegateCommand(() => { if (_selectedFile == null) { @@ -112,8 +124,6 @@ } }); - ReLoadDataCommand = new DelegateCommand(() => { Growl.Success("刷新成功"); }); - PageUpdatedCmd = new DelegateCommand>(args => { PictureFiles = _totalFiles diff --git a/Correlator/Views/PictureFileView.xaml b/Correlator/Views/PictureFileView.xaml index c111e10..b521016 100644 --- a/Correlator/Views/PictureFileView.xaml +++ b/Correlator/Views/PictureFileView.xaml @@ -103,85 +103,47 @@ FontSize="18" Header="文件大小" IsReadOnly="True" /> - + - + + - - - - - - - - - - - + + + + + + + \ No newline at end of file