|
@@ -495,7 +495,6 @@ namespace PDF_Office.ViewModels
|
|
#endregion 命令
|
|
#endregion 命令
|
|
|
|
|
|
public ViewContentViewModel(IRegionManager regionManager, IDialogService dialogService, IEventAggregator eventAggregator)
|
|
public ViewContentViewModel(IRegionManager regionManager, IDialogService dialogService, IEventAggregator eventAggregator)
|
|
-
|
|
|
|
{
|
|
{
|
|
region = regionManager;
|
|
region = regionManager;
|
|
dialogs = dialogService;
|
|
dialogs = dialogService;
|
|
@@ -514,7 +513,7 @@ namespace PDF_Office.ViewModels
|
|
TabControlSelectionChangedCommand = new DelegateCommand<object>(TabControlSelectonChangedEvent);
|
|
TabControlSelectionChangedCommand = new DelegateCommand<object>(TabControlSelectonChangedEvent);
|
|
|
|
|
|
ViwerRegionName = RegionNames.ViwerRegionName;
|
|
ViwerRegionName = RegionNames.ViwerRegionName;
|
|
- SplitViewerRegionName = RegionNames.SplitScreenViewRegionName;
|
|
|
|
|
|
+ SplitViewerRegionName = RegionNames.Viewer_SplitRegionName;
|
|
BOTARegionName = RegionNames.BOTARegionName;
|
|
BOTARegionName = RegionNames.BOTARegionName;
|
|
PropertyRegionName = RegionNames.PropertyRegionName;
|
|
PropertyRegionName = RegionNames.PropertyRegionName;
|
|
BottomToolRegionName = RegionNames.BottomToolRegionName;
|
|
BottomToolRegionName = RegionNames.BottomToolRegionName;
|
|
@@ -942,7 +941,7 @@ namespace PDF_Office.ViewModels
|
|
|
|
|
|
public bool IsNavigationTarget(NavigationContext navigationContext)
|
|
public bool IsNavigationTarget(NavigationContext navigationContext)
|
|
{
|
|
{
|
|
- return true;
|
|
|
|
|
|
+ return false;
|
|
}
|
|
}
|
|
|
|
|
|
public void OnNavigatedFrom(NavigationContext navigationContext)
|
|
public void OnNavigatedFrom(NavigationContext navigationContext)
|
|
@@ -992,21 +991,22 @@ namespace PDF_Office.ViewModels
|
|
private void LoadControl()
|
|
private void LoadControl()
|
|
{
|
|
{
|
|
//在构造函数中使用Region需要借助Dispatcher 确保UI已经加载完成,加载BOTA区域
|
|
//在构造函数中使用Region需要借助Dispatcher 确保UI已经加载完成,加载BOTA区域
|
|
- System.Windows.Application.Current.Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.Send, new Action(() =>
|
|
|
|
- {
|
|
|
|
- NavigationParameters parameters = new NavigationParameters();
|
|
|
|
- parameters.Add(ParameterNames.PDFViewer, PDFViewer);
|
|
|
|
- parameters.Add(ParameterNames.ViewContentViewModel, this);
|
|
|
|
-
|
|
|
|
- region.RequestNavigate(BOTARegionName, "BOTAContent", parameters);
|
|
|
|
- region.RequestNavigate(BottomToolRegionName, "BottomToolContent", parameters);
|
|
|
|
- region.RequestNavigate(ReadModeRegionName, "ReadModeContent", parameters);
|
|
|
|
- region.RequestNavigate(SplitViewerRegionName, "SplitScreenContent", parameters);
|
|
|
|
- //region.RequestNavigate(TipContentRegionName, "LinkAnnotTip", parameters);
|
|
|
|
- //TODO 根据上一次关闭记录的菜单,选中TabItem
|
|
|
|
- EnterSelectedBar("TabItemAnnotation");
|
|
|
|
- }
|
|
|
|
- ));
|
|
|
|
|
|
+ // 非必要情况不要使用该异步方法,可能会导致一次性加载多个文件时出现因异步引起的regionname 错乱问题
|
|
|
|
+ //System.Windows.Application.Current.Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.Send, new Action(() =>
|
|
|
|
+ // {
|
|
|
|
+ NavigationParameters parameters = new NavigationParameters();
|
|
|
|
+ parameters.Add(ParameterNames.PDFViewer, PDFViewer);
|
|
|
|
+ parameters.Add(ParameterNames.ViewContentViewModel, this);
|
|
|
|
+
|
|
|
|
+ region.RequestNavigate(BOTARegionName, "BOTAContent", parameters);
|
|
|
|
+ region.RequestNavigate(BottomToolRegionName, "BottomToolContent", parameters);
|
|
|
|
+ region.RequestNavigate(ReadModeRegionName, "ReadModeContent", parameters);
|
|
|
|
+ region.RequestNavigate(SplitViewerRegionName, "SplitScreenContent", parameters);
|
|
|
|
+ //region.RequestNavigate(TipContentRegionName, "LinkAnnotTip", parameters);
|
|
|
|
+ //TODO 根据上一次关闭记录的菜单,选中TabItem
|
|
|
|
+ EnterSelectedBar("TabItemAnnotation");
|
|
|
|
+ //}
|
|
|
|
+ //));
|
|
}
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
/// <summary>
|
|
@@ -1016,16 +1016,12 @@ namespace PDF_Office.ViewModels
|
|
/// <param name="annotPropertyPanel"></param>
|
|
/// <param name="annotPropertyPanel"></param>
|
|
public void SelectedPrpoertyPanel(string Content, AnnotPropertyPanel annotPropertyPanel)
|
|
public void SelectedPrpoertyPanel(string Content, AnnotPropertyPanel annotPropertyPanel)
|
|
{
|
|
{
|
|
- System.Windows.Application.Current.Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.Send, new Action(() =>
|
|
|
|
- {
|
|
|
|
- NavigationParameters parameters = new NavigationParameters();
|
|
|
|
- //传其他参数:文档类,空注释面板;
|
|
|
|
- parameters.Add(ParameterNames.PDFViewer, PDFViewer);
|
|
|
|
- parameters.Add(ParameterNames.PropertyPanelContentViewModel, annotPropertyPanel);
|
|
|
|
- parameters.Add(ParameterNames.ViewContentViewModel, this);
|
|
|
|
- region.RequestNavigate(PropertyRegionName, Content, parameters);
|
|
|
|
- }
|
|
|
|
- ));
|
|
|
|
|
|
+ NavigationParameters parameters = new NavigationParameters();
|
|
|
|
+ //传其他参数:文档类,空注释面板;
|
|
|
|
+ parameters.Add(ParameterNames.PDFViewer, PDFViewer);
|
|
|
|
+ parameters.Add(ParameterNames.PropertyPanelContentViewModel, annotPropertyPanel);
|
|
|
|
+ parameters.Add(ParameterNames.ViewContentViewModel, this);
|
|
|
|
+ region.RequestNavigate(PropertyRegionName, Content, parameters);
|
|
}
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
/// <summary>
|