|
@@ -38,17 +38,8 @@ namespace PDF_Office.ViewModels
|
|
|
|
|
|
public string ToolContentRegionName { get; set; }
|
|
|
|
|
|
-<<<<<<< Updated upstream
|
|
|
-=======
|
|
|
public string ToolsBarContentRegionName { get; set; }
|
|
|
|
|
|
- public DelegateCommand LoadFile { get; set; }
|
|
|
-
|
|
|
- public DelegateCommand Load { get; set; }
|
|
|
-
|
|
|
- public DelegateCommand<object> TabControlSelectionChangedCommand { get; set; }
|
|
|
-
|
|
|
->>>>>>> Stashed changes
|
|
|
|
|
|
|
|
|
private int gridToolRow = 1;
|
|
@@ -91,7 +82,6 @@ namespace PDF_Office.ViewModels
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-<<<<<<< Updated upstream
|
|
|
private Visibility isLoading = Visibility.Collapsed;
|
|
|
/// <summary>
|
|
|
/// 是否正在加载中
|
|
@@ -104,7 +94,7 @@ namespace PDF_Office.ViewModels
|
|
|
SetProperty(ref isLoading, value);
|
|
|
}
|
|
|
}
|
|
|
-=======
|
|
|
+
|
|
|
private Visibility toolsbarContentVisible = Visibility.Visible;
|
|
|
/// <summary>
|
|
|
/// 控制Content的显示
|
|
@@ -119,6 +109,7 @@ namespace PDF_Office.ViewModels
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+
|
|
|
private Dictionary<string, string> regionNameByTabItem;
|
|
|
|
|
|
private Dictionary<string, string> barContentByTabItem;
|
|
@@ -126,7 +117,7 @@ namespace PDF_Office.ViewModels
|
|
|
private string previousBar = "";
|
|
|
|
|
|
private string currentBar = "";
|
|
|
->>>>>>> Stashed changes
|
|
|
+
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
@@ -140,7 +131,7 @@ namespace PDF_Office.ViewModels
|
|
|
private double[] zoomLevel = { 1.00f, 10, 25, 50, 75, 100, 125, 150, 200, 300, 400, 600, 800, 1000 };
|
|
|
#endregion
|
|
|
|
|
|
-<<<<<<< Updated upstream
|
|
|
+
|
|
|
#region 命令
|
|
|
public DelegateCommand LoadFile { get; set; }
|
|
|
|
|
@@ -149,8 +140,6 @@ namespace PDF_Office.ViewModels
|
|
|
public DelegateCommand<object> TabControlSelectionChangedCommand { get; set; }
|
|
|
#endregion
|
|
|
|
|
|
-=======
|
|
|
->>>>>>> Stashed changes
|
|
|
public ViewContentViewModel(IRegionManager regionManager, IDialogService dialogService)
|
|
|
{
|
|
|
region = regionManager;
|
|
@@ -163,11 +152,9 @@ namespace PDF_Office.ViewModels
|
|
|
ViwerRegionName = Guid.NewGuid().ToString();
|
|
|
BOTARegionName = Guid.NewGuid().ToString();
|
|
|
PropertyRegionName = Guid.NewGuid().ToString();
|
|
|
-<<<<<<< Updated upstream
|
|
|
+
|
|
|
//未显示时无法注册上Region名称
|
|
|
ToolContentVisible = Visibility.Visible;
|
|
|
-=======
|
|
|
->>>>>>> Stashed changes
|
|
|
ToolContentRegionName = Guid.NewGuid().ToString();
|
|
|
ToolsBarContentRegionName = Guid.NewGuid().ToString();
|
|
|
|
|
@@ -220,29 +207,25 @@ namespace PDF_Office.ViewModels
|
|
|
if (args != null)
|
|
|
{
|
|
|
var item = args.AddedItems[0] as TabItem;
|
|
|
-<<<<<<< Updated upstream
|
|
|
- if (item.Name == "TabItemPageEdit")
|
|
|
- {
|
|
|
- EnterToolMode("PageEditContent");
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- ExitToolMode();
|
|
|
-=======
|
|
|
currentBar = item.Name;
|
|
|
if (previousBar != currentBar)
|
|
|
{
|
|
|
- if (previousBar != ""&&(currentBar== "TabItemPageEdit"|| currentBar == "TabItemTool"))
|
|
|
+ currentBar = item.Name;
|
|
|
+ if (previousBar != currentBar)
|
|
|
{
|
|
|
- ExitPreview();
|
|
|
+ if (previousBar != "" && (currentBar == "TabItemPageEdit" || currentBar == "TabItemTool"))
|
|
|
+ {
|
|
|
+ ExitToolMode();
|
|
|
+ }
|
|
|
+ if ((currentBar == "TabItemPageEdit" || currentBar == "TabItemTool"))
|
|
|
+ {
|
|
|
+ EnterSelectedBar(currentBar);
|
|
|
+ }
|
|
|
+ previousBar = currentBar;
|
|
|
+
|
|
|
}
|
|
|
- if ( (currentBar == "TabItemPageEdit" || currentBar == "TabItemTool"))
|
|
|
- {
|
|
|
- EnterSelectedBar(currentBar);
|
|
|
- }
|
|
|
- previousBar = currentBar;
|
|
|
->>>>>>> Stashed changes
|
|
|
}
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -324,11 +307,7 @@ namespace PDF_Office.ViewModels
|
|
|
private void ShowContent(string currentBar)
|
|
|
{
|
|
|
//显示页面编辑
|
|
|
-<<<<<<< Updated upstream
|
|
|
- if (isPageEdit)
|
|
|
-=======
|
|
|
if (currentBar == "TabItemPageEdit")
|
|
|
->>>>>>> Stashed changes
|
|
|
{
|
|
|
if (GridToolRow != 1)
|
|
|
{
|
|
@@ -339,26 +318,22 @@ namespace PDF_Office.ViewModels
|
|
|
{
|
|
|
GridToolRowSpan = 3;
|
|
|
}
|
|
|
-<<<<<<< Updated upstream
|
|
|
-
|
|
|
-=======
|
|
|
ToolContentVisible = Visibility.Visible;
|
|
|
->>>>>>> Stashed changes
|
|
|
+ ToolContentVisible = Visibility.Visible;
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
if (GridToolRow != 1)
|
|
|
{
|
|
|
GridToolRow = 1;
|
|
|
- }
|
|
|
+ }
|
|
|
ToolsBarContentVisible = Visibility.Visible;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
/// 进入工具编辑(如页面编辑、水印、密文等)模式
|
|
|
- /// </summary>
|
|
|
-<<<<<<< Updated upstream
|
|
|
+ /// </summary>
|
|
|
/// <param name="targetToolMode">要导航过去的控件名称</param>
|
|
|
/// <param name="valuePairs">导航需要传送的参数,为空时,默认传送PDFView和ViewContentViewModel</param>
|
|
|
private async void EnterToolMode(string targetToolMode, NavigationParameters valuePairs = null)
|
|
@@ -376,36 +351,26 @@ namespace PDF_Office.ViewModels
|
|
|
param = valuePairs;
|
|
|
}
|
|
|
region.RequestNavigate(ToolContentRegionName, targetToolMode, param);
|
|
|
+ ShowContent(currentBar);
|
|
|
|
|
|
- if (targetToolMode == "PageEditContent")
|
|
|
- {
|
|
|
- ShowToolContent();
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- ShowToolContent(false);
|
|
|
- }
|
|
|
IsLoading = Visibility.Collapsed;
|
|
|
-=======
|
|
|
+ }
|
|
|
+
|
|
|
private void EnterSelectedBar(string currentBar)
|
|
|
- {
|
|
|
- NavigationParameters param = new NavigationParameters();
|
|
|
- param.Add(ParameterNames.PDFViewer, PDFViewer);
|
|
|
- param.Add(ParameterNames.ViewContentViewModel, this);
|
|
|
- region.RequestNavigate(regionNameByTabItem[currentBar], barContentByTabItem[currentBar], param);
|
|
|
- ShowContent(currentBar);
|
|
|
->>>>>>> Stashed changes
|
|
|
+ {
|
|
|
+ NavigationParameters param = new NavigationParameters();
|
|
|
+ param.Add(ParameterNames.PDFViewer, PDFViewer);
|
|
|
+ param.Add(ParameterNames.ViewContentViewModel, this);
|
|
|
+ region.RequestNavigate(regionNameByTabItem[currentBar], barContentByTabItem[currentBar], param);
|
|
|
+ ShowContent(currentBar);
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
/// 退出工具(水印、密文等)编辑模式,隐藏ToolContent
|
|
|
/// </summary>
|
|
|
-<<<<<<< Updated upstream
|
|
|
+
|
|
|
|
|
|
public void ExitToolMode()
|
|
|
-=======
|
|
|
- public void ExitPreview()
|
|
|
->>>>>>> Stashed changes
|
|
|
{
|
|
|
ToolContentVisible = Visibility.Collapsed;
|
|
|
ToolsBarContentVisible = Visibility.Collapsed;
|
|
@@ -413,3 +378,6 @@ namespace PDF_Office.ViewModels
|
|
|
#endregion
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+
|