|
@@ -120,7 +120,10 @@ namespace PDF_Office.ViewModels
|
|
|
{
|
|
|
var fileList = dialog.FileNames.ToList().Where(x => !App.OpenedFileList.Exists(y => y == x)).ToList();
|
|
|
if (fileList.Count <= 0)
|
|
|
+ {
|
|
|
+ IsLoading = Visibility.Collapsed;
|
|
|
return;
|
|
|
+ }
|
|
|
|
|
|
IsLoading = Visibility.Visible;
|
|
|
//在当前页签打开第一个文件
|
|
@@ -138,7 +141,6 @@ namespace PDF_Office.ViewModels
|
|
|
{
|
|
|
if (!App.OpenedFileList.Contains(fileList[i]))
|
|
|
{
|
|
|
- //需要加一定延时 不然连续添加多个文件时会出现regionname重名的情况 因为多处导航是异步导航,可能绑定还没更新
|
|
|
App.mainWindowViewModel.AddTabItem(fileList[i]);
|
|
|
}
|
|
|
ToolMethod.SetFileThumbImg(fileList[i]);
|
|
@@ -199,15 +201,17 @@ namespace PDF_Office.ViewModels
|
|
|
{
|
|
|
var fileList = openFileDialog.FileNames.ToList().Where(x => !App.OpenedFileList.Exists(y => y == x)).ToList();
|
|
|
if (fileList.Count <= 0)
|
|
|
+ {
|
|
|
+ App.mainWindowViewModel.SelectItem(openFileDialog.FileName);
|
|
|
+ IsLoading = Visibility.Collapsed;
|
|
|
return;
|
|
|
+ }
|
|
|
|
|
|
mainContentViewModel.OpenFile(fileList[0]);
|
|
|
for (int i = 1; i < fileList.Count(); i++)
|
|
|
{
|
|
|
if (!App.OpenedFileList.Contains(fileList[i]))
|
|
|
{
|
|
|
- //需要加一定延时 不然连续添加多个文件时会出现regionname重名的情况 因为多处导航是异步导航,可能绑定还没更新
|
|
|
- await Task.Delay(20);
|
|
|
App.mainWindowViewModel.AddTabItem(fileList[i]);
|
|
|
}
|
|
|
ToolMethod.SetFileThumbImg(fileList[i]);
|