|
@@ -22,6 +22,8 @@ using PDF_Office.Views.Tools;
|
|
|
using PDFSettings.Settings;
|
|
|
using PDF_Office.Helper;
|
|
|
using System.IO;
|
|
|
+using ImTools;
|
|
|
+using PDF_Office.Views.PropertyPanel.ViewModular;
|
|
|
|
|
|
namespace PDF_Office.ViewModels
|
|
|
{
|
|
@@ -69,7 +71,8 @@ namespace PDF_Office.ViewModels
|
|
|
T_FitPage = App.MainPageLoader.GetString("Zoom_FitPage");
|
|
|
}
|
|
|
|
|
|
- #endregion
|
|
|
+ #endregion 文案
|
|
|
+
|
|
|
public DelegateCommand Load { get; set; }
|
|
|
|
|
|
public DelegateCommand FirstPageCommand { get; set; }
|
|
@@ -343,33 +346,54 @@ namespace PDF_Office.ViewModels
|
|
|
|
|
|
private void ShowViewModularEvent(object obj)
|
|
|
{
|
|
|
- if (ViewContentViewModel.IsPropertyOpen == false)
|
|
|
+ ViewContentViewModel.IsPropertyOpen = true;
|
|
|
+ if (region.Regions.ContainsRegionWithName(ViewContentViewModel.PropertyRegionName))
|
|
|
{
|
|
|
- ViewContentViewModel.IsPropertyOpen = true;
|
|
|
-
|
|
|
- NavigationParameters param = new NavigationParameters();
|
|
|
- param.Add(ParameterNames.PDFViewer, PDFViewer);
|
|
|
- param.Add(ParameterNames.BottomToolContentViewModel, this);
|
|
|
- region.RequestNavigate(RegionNames.PropertyRegionName, "ViewModularContent", param);
|
|
|
-
|
|
|
- if (region.Regions.ContainsRegionWithName(ViewContentViewModel.PropertyRegionName))
|
|
|
+ var views = region.Regions[ViewContentViewModel.PropertyRegionName].Views;
|
|
|
+ var item = views.FindFirst(p => p is ViewModularContent);
|
|
|
+ if (item == null)
|
|
|
{
|
|
|
- var views = region.Regions[ViewContentViewModel.PropertyRegionName].Views;
|
|
|
- foreach (var item in views)
|
|
|
+ NavigationParameters param = new NavigationParameters();
|
|
|
+ param.Add(ParameterNames.PDFViewer, PDFViewer);
|
|
|
+ param.Add(ParameterNames.BottomToolContentViewModel, this);
|
|
|
+ region.RequestNavigate(RegionNames.PropertyRegionName, "ViewModularContent", param);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ if (item is ViewModularContent bOTAContent1)
|
|
|
{
|
|
|
- if (item is LinkAnnotProperty linkAnnotProperty)
|
|
|
- {
|
|
|
- var contentRegion = region.Regions[ViewContentViewModel.PropertyRegionName];
|
|
|
- contentRegion.Remove(item);
|
|
|
- break;
|
|
|
- }
|
|
|
+ var contentRegion = region.Regions[ViewContentViewModel.PropertyRegionName];
|
|
|
+ contentRegion.Activate(bOTAContent1);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- else
|
|
|
- {
|
|
|
- ViewContentViewModel.IsPropertyOpen = false;
|
|
|
- }
|
|
|
+
|
|
|
+ //if (ViewContentViewModel.IsPropertyOpen == false)
|
|
|
+ //{
|
|
|
+ // ViewContentViewModel.IsPropertyOpen = true;
|
|
|
+
|
|
|
+ // NavigationParameters param = new NavigationParameters();
|
|
|
+ // param.Add(ParameterNames.PDFViewer, PDFViewer);
|
|
|
+ // param.Add(ParameterNames.BottomToolContentViewModel, this);
|
|
|
+ // region.RequestNavigate(RegionNames.PropertyRegionName, "ViewModularContent", param);
|
|
|
+
|
|
|
+ // //if (region.Regions.ContainsRegionWithName(ViewContentViewModel.PropertyRegionName))
|
|
|
+ // //{
|
|
|
+ // // var views = region.Regions[ViewContentViewModel.PropertyRegionName].Views;
|
|
|
+ // // foreach (var item in views)
|
|
|
+ // // {
|
|
|
+ // // if (item is LinkAnnotProperty linkAnnotProperty)
|
|
|
+ // // {
|
|
|
+ // // var contentRegion = region.Regions[ViewContentViewModel.PropertyRegionName];
|
|
|
+ // // contentRegion.Remove(item);
|
|
|
+ // // break;
|
|
|
+ // // }
|
|
|
+ // // }
|
|
|
+ // //}
|
|
|
+ //}
|
|
|
+ //else
|
|
|
+ //{
|
|
|
+ //}
|
|
|
IsShowViewModular = ViewContentViewModel.IsPropertyOpen;
|
|
|
}
|
|
|
|