|
@@ -1,4 +1,5 @@
|
|
-using ComPDFKitViewer;
|
|
|
|
|
|
+using ComPDFKit.PDFPage;
|
|
|
|
+using ComPDFKitViewer;
|
|
using ComPDFKitViewer.AnnotEvent;
|
|
using ComPDFKitViewer.AnnotEvent;
|
|
using ComPDFKitViewer.PdfViewer;
|
|
using ComPDFKitViewer.PdfViewer;
|
|
using Microsoft.Win32;
|
|
using Microsoft.Win32;
|
|
@@ -7,6 +8,7 @@ using PDF_Master.Helper;
|
|
using PDF_Master.Model;
|
|
using PDF_Master.Model;
|
|
using PDF_Master.Model.AnnotPanel;
|
|
using PDF_Master.Model.AnnotPanel;
|
|
using PDF_Master.Model.PropertyPanel.AnnotPanel;
|
|
using PDF_Master.Model.PropertyPanel.AnnotPanel;
|
|
|
|
+using PDF_Master.Properties;
|
|
using PDF_Master.ViewModels.Tools.AnnotManager;
|
|
using PDF_Master.ViewModels.Tools.AnnotManager;
|
|
using PDFSettings;
|
|
using PDFSettings;
|
|
using Prism.Commands;
|
|
using Prism.Commands;
|
|
@@ -14,6 +16,7 @@ using Prism.Mvvm;
|
|
using Prism.Regions;
|
|
using Prism.Regions;
|
|
using System;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Collections.Generic;
|
|
|
|
+using System.Diagnostics;
|
|
using System.Linq;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using System.Threading.Tasks;
|
|
@@ -21,30 +24,35 @@ using System.Windows;
|
|
using System.Windows.Controls;
|
|
using System.Windows.Controls;
|
|
using System.Windows.Input;
|
|
using System.Windows.Input;
|
|
using System.Windows.Media;
|
|
using System.Windows.Media;
|
|
|
|
+using static Dropbox.Api.Files.WriteMode;
|
|
|
|
|
|
namespace PDF_Master.ViewModels.PropertyPanel.PDFEdit
|
|
namespace PDF_Master.ViewModels.PropertyPanel.PDFEdit
|
|
{
|
|
{
|
|
-
|
|
|
|
public class TextEditPropertyViewModel : PDFEditVM, INavigationAware
|
|
public class TextEditPropertyViewModel : PDFEditVM, INavigationAware
|
|
{
|
|
{
|
|
-
|
|
|
|
#region 属性
|
|
#region 属性
|
|
|
|
+
|
|
public event EventHandler ClearCheckedAglin;
|
|
public event EventHandler ClearCheckedAglin;
|
|
|
|
+
|
|
public TextEditPropertyViewModel()
|
|
public TextEditPropertyViewModel()
|
|
{
|
|
{
|
|
InitVariable();
|
|
InitVariable();
|
|
InitCommand();
|
|
InitCommand();
|
|
}
|
|
}
|
|
|
|
+
|
|
private void InitVariable()
|
|
private void InitVariable()
|
|
{
|
|
{
|
|
InitBaseVariable();
|
|
InitBaseVariable();
|
|
}
|
|
}
|
|
|
|
+
|
|
private bool isSelectedEmpty;
|
|
private bool isSelectedEmpty;
|
|
|
|
+
|
|
public bool IsSelectedEmpty
|
|
public bool IsSelectedEmpty
|
|
{
|
|
{
|
|
get { return isSelectedEmpty; }
|
|
get { return isSelectedEmpty; }
|
|
set { SetProperty(ref isSelectedEmpty, value); }
|
|
set { SetProperty(ref isSelectedEmpty, value); }
|
|
}
|
|
}
|
|
|
|
+
|
|
private string title;
|
|
private string title;
|
|
|
|
|
|
public string Title
|
|
public string Title
|
|
@@ -55,6 +63,7 @@ namespace PDF_Master.ViewModels.PropertyPanel.PDFEdit
|
|
SetProperty(ref title, value);
|
|
SetProperty(ref title, value);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+
|
|
private FontBoardVm _fontVm = new FontBoardVm(true);
|
|
private FontBoardVm _fontVm = new FontBoardVm(true);
|
|
|
|
|
|
public FontBoardVm FontVm
|
|
public FontBoardVm FontVm
|
|
@@ -63,17 +72,18 @@ namespace PDF_Master.ViewModels.PropertyPanel.PDFEdit
|
|
set { SetProperty(ref _fontVm, value); }
|
|
set { SetProperty(ref _fontVm, value); }
|
|
}
|
|
}
|
|
|
|
|
|
-
|
|
|
|
private ComPDFKit.PDFPage.Edit.TextAlignType _textAlign;
|
|
private ComPDFKit.PDFPage.Edit.TextAlignType _textAlign;
|
|
|
|
+
|
|
public ComPDFKit.PDFPage.Edit.TextAlignType TextAlign
|
|
public ComPDFKit.PDFPage.Edit.TextAlignType TextAlign
|
|
{
|
|
{
|
|
get { return _textAlign; }
|
|
get { return _textAlign; }
|
|
set { _textAlign = value; }
|
|
set { _textAlign = value; }
|
|
}
|
|
}
|
|
- #endregion
|
|
|
|
|
|
+
|
|
|
|
+ #endregion 属性
|
|
|
|
+
|
|
#region Command
|
|
#region Command
|
|
|
|
|
|
-
|
|
|
|
public DelegateCommand AddTextCommand { get; set; }
|
|
public DelegateCommand AddTextCommand { get; set; }
|
|
public DelegateCommand AddImgCommand { get; set; }
|
|
public DelegateCommand AddImgCommand { get; set; }
|
|
|
|
|
|
@@ -83,8 +93,10 @@ namespace PDF_Master.ViewModels.PropertyPanel.PDFEdit
|
|
public DelegateCommand<object> FontSizeChangedCommand { get; set; }
|
|
public DelegateCommand<object> FontSizeChangedCommand { get; set; }
|
|
|
|
|
|
public DelegateCommand<object> TextAlignCheckedCommand { get; set; }
|
|
public DelegateCommand<object> TextAlignCheckedCommand { get; set; }
|
|
|
|
+
|
|
//进入属性面板编辑
|
|
//进入属性面板编辑
|
|
public DelegateCommand EditTextModeCommand { get; set; }
|
|
public DelegateCommand EditTextModeCommand { get; set; }
|
|
|
|
+
|
|
public DelegateCommand FontFamilyChangedCommand { get; set; }
|
|
public DelegateCommand FontFamilyChangedCommand { get; set; }
|
|
public DelegateCommand CustomFontStyleCommand { get; set; }
|
|
public DelegateCommand CustomFontStyleCommand { get; set; }
|
|
public DelegateCommand FontStyleWeightChangedCommand { get; set; }
|
|
public DelegateCommand FontStyleWeightChangedCommand { get; set; }
|
|
@@ -92,14 +104,13 @@ namespace PDF_Master.ViewModels.PropertyPanel.PDFEdit
|
|
|
|
|
|
//重定义
|
|
//重定义
|
|
public DelegateCommand ReDefineFontStyleCommand { get; set; }
|
|
public DelegateCommand ReDefineFontStyleCommand { get; set; }
|
|
|
|
+
|
|
public DelegateCommand RestoreDefaultStyleCommand { get; set; }
|
|
public DelegateCommand RestoreDefaultStyleCommand { get; set; }
|
|
public DelegateCommand<object> LayoutAlignCheckedCommand { get; set; }
|
|
public DelegateCommand<object> LayoutAlignCheckedCommand { get; set; }
|
|
-
|
|
|
|
|
|
|
|
- #endregion
|
|
|
|
|
|
+ #endregion Command
|
|
|
|
|
|
#region 初始化
|
|
#region 初始化
|
|
-
|
|
|
|
|
|
|
|
private void InitCommand()
|
|
private void InitCommand()
|
|
{
|
|
{
|
|
@@ -133,7 +144,7 @@ namespace PDF_Master.ViewModels.PropertyPanel.PDFEdit
|
|
LayoutAlignCheckedCommand = new DelegateCommand<object>(LayoutAlignChecked);
|
|
LayoutAlignCheckedCommand = new DelegateCommand<object>(LayoutAlignChecked);
|
|
}
|
|
}
|
|
|
|
|
|
- #endregion
|
|
|
|
|
|
+ #endregion 初始化
|
|
|
|
|
|
#region 文本处理逻辑
|
|
#region 文本处理逻辑
|
|
|
|
|
|
@@ -150,8 +161,8 @@ namespace PDF_Master.ViewModels.PropertyPanel.PDFEdit
|
|
|
|
|
|
private void EditTextMode()
|
|
private void EditTextMode()
|
|
{
|
|
{
|
|
-
|
|
|
|
}
|
|
}
|
|
|
|
+
|
|
/// <summary>
|
|
/// <summary>
|
|
/// 从预设样式设置文本
|
|
/// 从预设样式设置文本
|
|
/// </summary>
|
|
/// </summary>
|
|
@@ -170,7 +181,11 @@ namespace PDF_Master.ViewModels.PropertyPanel.PDFEdit
|
|
|
|
|
|
if (item.mFontFamily != null)
|
|
if (item.mFontFamily != null)
|
|
{
|
|
{
|
|
- GetCurrentFontFamily(item.mFontFamily.ToString(), item.mFontFamily.ToString());
|
|
|
|
|
|
+ //GetCurrentFontFamily(item.mFontFamily.ToString(), item.mFontFamily.ToString());
|
|
|
|
+ if (GetCurrentFontFamily(item) == false)
|
|
|
|
+ {
|
|
|
|
+ GetCurrentFontFamily(item.mFontFamily.ToString(), item.mFontFamily.ToString());
|
|
|
|
+ }
|
|
}
|
|
}
|
|
GetFontWeights_Style(item.mFontStyle, item.mFontWeight);
|
|
GetFontWeights_Style(item.mFontStyle, item.mFontWeight);
|
|
//CurrentFontSize = new ComboDataItem(TextEditEvent.FontSize);
|
|
//CurrentFontSize = new ComboDataItem(TextEditEvent.FontSize);
|
|
@@ -182,12 +197,31 @@ namespace PDF_Master.ViewModels.PropertyPanel.PDFEdit
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ /// <summary>
|
|
|
|
+ /// 编辑 获取预设字体,需要做处理,有些字体带空格,不做处理无法识别
|
|
|
|
+ /// </summary>
|
|
|
|
+ /// <param name="item"></param>
|
|
|
|
+ /// <returns></returns>
|
|
|
|
+ private bool GetCurrentFontFamily(PresetFontItem item)
|
|
|
|
+ {
|
|
|
|
+ DefaultEditProperty defaultEdit = SettingHelper.GetPDFEditDefaultProperty(CPDFEditType.EditText);
|
|
|
|
+ if (defaultEdit != null && defaultEdit.SystemFontNameList != null)
|
|
|
|
+ {
|
|
|
|
+ List<string> itemq = defaultEdit.SystemFontNameList.FindAll(p => p.Replace(" ", "").Equals(item.mFontFamily.ToString()));
|
|
|
|
+ if (itemq != null && itemq.Count > 0)
|
|
|
|
+ {
|
|
|
|
+ GetCurrentFontFamily(item.mFontFamily.ToString(), itemq[0]);
|
|
|
|
+ return true;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+
|
|
/// <summary>
|
|
/// <summary>
|
|
/// 自定义文字样式
|
|
/// 自定义文字样式
|
|
/// </summary>
|
|
/// </summary>
|
|
private void CustomFontStyle()
|
|
private void CustomFontStyle()
|
|
{
|
|
{
|
|
-
|
|
|
|
if (CurrentPresetFont != null)
|
|
if (CurrentPresetFont != null)
|
|
{
|
|
{
|
|
ContextMenu menu;
|
|
ContextMenu menu;
|
|
@@ -203,7 +237,6 @@ namespace PDF_Master.ViewModels.PropertyPanel.PDFEdit
|
|
var currentItem = PresetFontList.FirstOrDefault(temp => temp.mTag == CurrentPresetFont.ValueStr);
|
|
var currentItem = PresetFontList.FirstOrDefault(temp => temp.mTag == CurrentPresetFont.ValueStr);
|
|
if (currentItem.mTag != "Custom")
|
|
if (currentItem.mTag != "Custom")
|
|
{
|
|
{
|
|
-
|
|
|
|
if (FontWeightItem != defaulItem.mFontWeight ||
|
|
if (FontWeightItem != defaulItem.mFontWeight ||
|
|
FontStyleItem != defaulItem.mFontStyle ||
|
|
FontStyleItem != defaulItem.mFontStyle ||
|
|
CurrentFontSize.Value != defaulItem.mFontSize ||
|
|
CurrentFontSize.Value != defaulItem.mFontSize ||
|
|
@@ -219,8 +252,6 @@ namespace PDF_Master.ViewModels.PropertyPanel.PDFEdit
|
|
menu.IsOpen = true;
|
|
menu.IsOpen = true;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-
|
|
|
|
-
|
|
|
|
}
|
|
}
|
|
|
|
|
|
//设置字体样式
|
|
//设置字体样式
|
|
@@ -237,26 +268,16 @@ namespace PDF_Master.ViewModels.PropertyPanel.PDFEdit
|
|
{
|
|
{
|
|
if (CurrentFontFamily.ValueStr != item.mFontFamily.Source)
|
|
if (CurrentFontFamily.ValueStr != item.mFontFamily.Source)
|
|
{
|
|
{
|
|
- string txt = string.Format($" * {currentItem.mTagContent}");
|
|
|
|
-
|
|
|
|
- if (Title == txt)
|
|
|
|
|
|
+ if (noAddAnAsterisk(currentItem, item) == false)
|
|
{
|
|
{
|
|
- Title = "";
|
|
|
|
|
|
+ break;
|
|
}
|
|
}
|
|
- Title = txt;
|
|
|
|
- break;
|
|
|
|
}
|
|
}
|
|
else
|
|
else
|
|
{
|
|
{
|
|
- if (FontWeightItem == item.mFontWeight && FontStyleItem == item.mFontStyle && CurrentFontSize.Value == item.mFontSize && CurrentFontFamily.ValueStr == item.mFontFamily.Source)
|
|
|
|
|
|
+ if (noAddAnAsterisk(currentItem, item) == false)
|
|
{
|
|
{
|
|
- string txt = currentItem.mTagContent;
|
|
|
|
-
|
|
|
|
- if (Title == txt)
|
|
|
|
- {
|
|
|
|
- Title = "";
|
|
|
|
- }
|
|
|
|
- Title = txt;
|
|
|
|
|
|
+ break;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -265,6 +286,37 @@ namespace PDF_Master.ViewModels.PropertyPanel.PDFEdit
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ private bool noAddAnAsterisk(PresetFontItem currentItem, PresetFontItem item)
|
|
|
|
+ {
|
|
|
|
+ if (FontWeightItem == item.mFontWeight && FontStyleItem == item.mFontStyle && CurrentFontSize.Value == item.mFontSize && (CurrentFontFamily.ValueStr == item.mFontFamily.Source || (CurrentFontFamily.ValueStr == "Arial" && item.mFontFamily.Source == "Helvetica")))
|
|
|
|
+ {
|
|
|
|
+ string txt = currentItem.mTagContent;
|
|
|
|
+
|
|
|
|
+ if (Title == txt)
|
|
|
|
+ {
|
|
|
|
+ Title = "";
|
|
|
|
+ }
|
|
|
|
+ Title = txt;
|
|
|
|
+ return true;
|
|
|
|
+ }
|
|
|
|
+ else
|
|
|
|
+ {
|
|
|
|
+ addAnAsterisk(currentItem);
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ private void addAnAsterisk(PresetFontItem currentItem)
|
|
|
|
+ {
|
|
|
|
+ string txt = string.Format($" * {currentItem.mTagContent}");
|
|
|
|
+
|
|
|
|
+ if (Title == txt)
|
|
|
|
+ {
|
|
|
|
+ Title = "";
|
|
|
|
+ }
|
|
|
|
+ Title = txt;
|
|
|
|
+ }
|
|
|
|
+
|
|
/// <summary>
|
|
/// <summary>
|
|
/// 设置文本字重、样式
|
|
/// 设置文本字重、样式
|
|
/// </summary>
|
|
/// </summary>
|
|
@@ -321,7 +373,6 @@ namespace PDF_Master.ViewModels.PropertyPanel.PDFEdit
|
|
/// </summary>
|
|
/// </summary>
|
|
private void ReDefineFontStyle()
|
|
private void ReDefineFontStyle()
|
|
{
|
|
{
|
|
-
|
|
|
|
var item = PresetFontList.FirstOrDefault(temp => temp.mTag == CurrentPresetFont.ValueStr);
|
|
var item = PresetFontList.FirstOrDefault(temp => temp.mTag == CurrentPresetFont.ValueStr);
|
|
if (item == null) return;
|
|
if (item == null) return;
|
|
|
|
|
|
@@ -351,10 +402,9 @@ namespace PDF_Master.ViewModels.PropertyPanel.PDFEdit
|
|
item.mFontSize = (int)CurrentFontSize.Value;
|
|
item.mFontSize = (int)CurrentFontSize.Value;
|
|
|
|
|
|
CurrentPresetFont = new ComboDataItem(item.mTag, item.mTagContent);
|
|
CurrentPresetFont = new ComboDataItem(item.mTag, item.mTagContent);
|
|
- SelectedPresetFont();
|
|
|
|
|
|
+ //SelectedPresetFont();
|
|
//更改后 保存到本地缓存
|
|
//更改后 保存到本地缓存
|
|
- TextFont.SavePresetFontList(PresetFontList);
|
|
|
|
-
|
|
|
|
|
|
+ TextFont.SavePresetEditFontList(PresetFontList);
|
|
}
|
|
}
|
|
|
|
|
|
//重置定义
|
|
//重置定义
|
|
@@ -363,7 +413,7 @@ namespace PDF_Master.ViewModels.PropertyPanel.PDFEdit
|
|
var defaultlists = TextFont.GetPresetFontStyle();
|
|
var defaultlists = TextFont.GetPresetFontStyle();
|
|
if (CurrentPresetFont.ValueStr != "Custom")
|
|
if (CurrentPresetFont.ValueStr != "Custom")
|
|
{
|
|
{
|
|
- var defaulItem = defaultlists.FirstOrDefault(temp => temp.mTag ==CurrentPresetFont.ValueStr);
|
|
|
|
|
|
+ var defaulItem = defaultlists.FirstOrDefault(temp => temp.mTag == CurrentPresetFont.ValueStr);
|
|
if (defaulItem != null)
|
|
if (defaulItem != null)
|
|
{
|
|
{
|
|
var currentItem = PresetFontList.FirstOrDefault(temp => temp.mTag == CurrentPresetFont.ValueStr);
|
|
var currentItem = PresetFontList.FirstOrDefault(temp => temp.mTag == CurrentPresetFont.ValueStr);
|
|
@@ -374,16 +424,19 @@ namespace PDF_Master.ViewModels.PropertyPanel.PDFEdit
|
|
currentItem.mFontWeight = defaulItem.mFontWeight;
|
|
currentItem.mFontWeight = defaulItem.mFontWeight;
|
|
currentItem.mFontFamily = defaulItem.mFontFamily;
|
|
currentItem.mFontFamily = defaulItem.mFontFamily;
|
|
currentItem.mFontSize = defaulItem.mFontSize;
|
|
currentItem.mFontSize = defaulItem.mFontSize;
|
|
- GetCurrentFontFamily(currentItem.mFontFamily.ToString(), currentItem.mFontFamily.ToString());
|
|
|
|
- GetCurrentFontSize(currentItem.mFontSize);
|
|
|
|
|
|
+ //GetCurrentFontFamily(currentItem.mFontFamily.ToString(), currentItem.mFontFamily.ToString());
|
|
|
|
+ if (GetCurrentFontFamily(currentItem) == false)
|
|
|
|
+ {
|
|
|
|
+ GetCurrentFontFamily(currentItem.mFontFamily.ToString(), currentItem.mFontFamily.ToString());
|
|
|
|
+ }
|
|
|
|
+ GetCurrentFontSize(currentItem.mFontSize);
|
|
GetFontWeights_Style(currentItem.mFontStyle, currentItem.mFontWeight);
|
|
GetFontWeights_Style(currentItem.mFontStyle, currentItem.mFontWeight);
|
|
CurrentPresetFont = new ComboDataItem(defaulItem.mTag, defaulItem.mTagContent);
|
|
CurrentPresetFont = new ComboDataItem(defaulItem.mTag, defaulItem.mTagContent);
|
|
SelectedPresetFont();
|
|
SelectedPresetFont();
|
|
- TextFont.SavePresetFontList(PresetFontList);
|
|
|
|
|
|
+ TextFont.SavePresetEditFontList(PresetFontList);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-
|
|
|
|
}
|
|
}
|
|
|
|
|
|
//设置多选对齐方式
|
|
//设置多选对齐方式
|
|
@@ -398,34 +451,39 @@ namespace PDF_Master.ViewModels.PropertyPanel.PDFEdit
|
|
case "AlignLeft":
|
|
case "AlignLeft":
|
|
PDFViewer.SetPDFEditAligment(AlignModes.AlignLeft);
|
|
PDFViewer.SetPDFEditAligment(AlignModes.AlignLeft);
|
|
break;
|
|
break;
|
|
|
|
+
|
|
case "AlignHorizonCenter":
|
|
case "AlignHorizonCenter":
|
|
PDFViewer.SetPDFEditAligment(AlignModes.AlignHorizonCenter);
|
|
PDFViewer.SetPDFEditAligment(AlignModes.AlignHorizonCenter);
|
|
break;
|
|
break;
|
|
|
|
+
|
|
case "AlignRight":
|
|
case "AlignRight":
|
|
PDFViewer.SetPDFEditAligment(AlignModes.AlignRight);
|
|
PDFViewer.SetPDFEditAligment(AlignModes.AlignRight);
|
|
break;
|
|
break;
|
|
|
|
+
|
|
case "DistributeHorizontal":
|
|
case "DistributeHorizontal":
|
|
PDFViewer.SetPDFEditAligment(AlignModes.DistributeHorizontal);
|
|
PDFViewer.SetPDFEditAligment(AlignModes.DistributeHorizontal);
|
|
break;
|
|
break;
|
|
|
|
+
|
|
case "AlignTop":
|
|
case "AlignTop":
|
|
PDFViewer.SetPDFEditAligment(AlignModes.AlignTop);
|
|
PDFViewer.SetPDFEditAligment(AlignModes.AlignTop);
|
|
break;
|
|
break;
|
|
|
|
+
|
|
case "AlignVerticalCenter":
|
|
case "AlignVerticalCenter":
|
|
PDFViewer.SetPDFEditAligment(AlignModes.AlignVerticalCenter);
|
|
PDFViewer.SetPDFEditAligment(AlignModes.AlignVerticalCenter);
|
|
break;
|
|
break;
|
|
|
|
+
|
|
case "AlignBottom":
|
|
case "AlignBottom":
|
|
PDFViewer.SetPDFEditAligment(AlignModes.AlignBottom);
|
|
PDFViewer.SetPDFEditAligment(AlignModes.AlignBottom);
|
|
break;
|
|
break;
|
|
|
|
+
|
|
case "DistributeVertical":
|
|
case "DistributeVertical":
|
|
PDFViewer.SetPDFEditAligment(AlignModes.DistributeVertical);
|
|
PDFViewer.SetPDFEditAligment(AlignModes.DistributeVertical);
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
-
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
-
|
|
|
|
//设置文本框内对齐方式
|
|
//设置文本框内对齐方式
|
|
private void TextAlignChecked(object obj)
|
|
private void TextAlignChecked(object obj)
|
|
{
|
|
{
|
|
@@ -494,7 +552,6 @@ namespace PDF_Master.ViewModels.PropertyPanel.PDFEdit
|
|
if (colorValue != null)
|
|
if (colorValue != null)
|
|
{
|
|
{
|
|
SelectColor = new SolidColorBrush(colorValue);
|
|
SelectColor = new SolidColorBrush(colorValue);
|
|
-
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -505,11 +562,9 @@ namespace PDF_Master.ViewModels.PropertyPanel.PDFEdit
|
|
if (obj != null && (PresetFontItem)obj != null)
|
|
if (obj != null && (PresetFontItem)obj != null)
|
|
{
|
|
{
|
|
var item = (PresetFontItem)obj;
|
|
var item = (PresetFontItem)obj;
|
|
-
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
-
|
|
|
|
//设置字体大小
|
|
//设置字体大小
|
|
private void FontSizeChanged(object obj)
|
|
private void FontSizeChanged(object obj)
|
|
{
|
|
{
|
|
@@ -556,8 +611,7 @@ namespace PDF_Master.ViewModels.PropertyPanel.PDFEdit
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
-
|
|
|
|
- #endregion
|
|
|
|
|
|
+ #endregion 文本处理逻辑
|
|
|
|
|
|
#region 右键菜单
|
|
#region 右键菜单
|
|
|
|
|
|
@@ -576,9 +630,7 @@ namespace PDF_Master.ViewModels.PropertyPanel.PDFEdit
|
|
return popMenu;
|
|
return popMenu;
|
|
}
|
|
}
|
|
|
|
|
|
-
|
|
|
|
- #endregion
|
|
|
|
-
|
|
|
|
|
|
+ #endregion 右键菜单
|
|
|
|
|
|
#region 编辑PDF内容触发的事件
|
|
#region 编辑PDF内容触发的事件
|
|
|
|
|
|
@@ -587,7 +639,6 @@ namespace PDF_Master.ViewModels.PropertyPanel.PDFEdit
|
|
/// </summary>
|
|
/// </summary>
|
|
private void PDFViewer_PDFEditCommandHandler(object sender, PDFEditCommand e)
|
|
private void PDFViewer_PDFEditCommandHandler(object sender, PDFEditCommand e)
|
|
{
|
|
{
|
|
-
|
|
|
|
//if (e == null)
|
|
//if (e == null)
|
|
// return;
|
|
// return;
|
|
|
|
|
|
@@ -630,7 +681,6 @@ namespace PDF_Master.ViewModels.PropertyPanel.PDFEdit
|
|
menuItem.IsEnabled = false;
|
|
menuItem.IsEnabled = false;
|
|
if (currentItem.mTag != "Custom")
|
|
if (currentItem.mTag != "Custom")
|
|
{
|
|
{
|
|
-
|
|
|
|
if (FontWeightItem != currentItem.mFontWeight ||
|
|
if (FontWeightItem != currentItem.mFontWeight ||
|
|
FontStyleItem != currentItem.mFontStyle ||
|
|
FontStyleItem != currentItem.mFontStyle ||
|
|
CurrentFontSize.Value != currentItem.mFontSize ||
|
|
CurrentFontSize.Value != currentItem.mFontSize ||
|
|
@@ -640,7 +690,7 @@ namespace PDF_Master.ViewModels.PropertyPanel.PDFEdit
|
|
menuItem.Command = ReDefineFontStyleCommand;
|
|
menuItem.Command = ReDefineFontStyleCommand;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
//恢复默认预设样式
|
|
//恢复默认预设样式
|
|
menuItem = popMenu.Items[1] as MenuItem;
|
|
menuItem = popMenu.Items[1] as MenuItem;
|
|
menuItem.IsEnabled = isEnable;
|
|
menuItem.IsEnabled = isEnable;
|
|
@@ -648,25 +698,25 @@ namespace PDF_Master.ViewModels.PropertyPanel.PDFEdit
|
|
}
|
|
}
|
|
return popMenu;
|
|
return popMenu;
|
|
}
|
|
}
|
|
- #endregion
|
|
|
|
|
|
+
|
|
|
|
+ #endregion 编辑PDF内容触发的事件
|
|
|
|
|
|
protected List<PDFEditEvent> TextEditEventList;
|
|
protected List<PDFEditEvent> TextEditEventList;
|
|
|
|
+
|
|
public void OnNavigatedTo(NavigationContext navigationContext)
|
|
public void OnNavigatedTo(NavigationContext navigationContext)
|
|
{
|
|
{
|
|
-
|
|
|
|
navigationContext.Parameters.TryGetValue<CPDFViewer>(ParameterNames.PDFViewer, out PDFViewer);
|
|
navigationContext.Parameters.TryGetValue<CPDFViewer>(ParameterNames.PDFViewer, out PDFViewer);
|
|
navigationContext.Parameters.TryGetValue<List<PDFEditEvent>>(ParameterNames.AnnotEvent, out TextEditEventList);
|
|
navigationContext.Parameters.TryGetValue<List<PDFEditEvent>>(ParameterNames.AnnotEvent, out TextEditEventList);
|
|
if (PDFViewer != null)
|
|
if (PDFViewer != null)
|
|
{
|
|
{
|
|
-
|
|
|
|
if (TextEditEventList != null && TextEditEventList.Count > 0)
|
|
if (TextEditEventList != null && TextEditEventList.Count > 0)
|
|
{
|
|
{
|
|
TextEditEvent = TextEditEventList[0];
|
|
TextEditEvent = TextEditEventList[0];
|
|
- if(TextEditEvent.FontName!=""&& TextEditEvent.FontName !=null)
|
|
|
|
|
|
+ if (TextEditEvent.FontName != "" && TextEditEvent.FontName != null)
|
|
{
|
|
{
|
|
GetPDFEdit();
|
|
GetPDFEdit();
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
if (TextEditEventList.Count > 1)
|
|
if (TextEditEventList.Count > 1)
|
|
IsSelectedEmpty = true;
|
|
IsSelectedEmpty = true;
|
|
else
|
|
else
|
|
@@ -688,39 +738,28 @@ namespace PDF_Master.ViewModels.PropertyPanel.PDFEdit
|
|
IsLayoutAvgAlign = false;
|
|
IsLayoutAvgAlign = false;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- else if(TextEditEventList==null|| TextEditEvent.FontName == null|| TextEditEvent.FontName == "")
|
|
|
|
|
|
+ else if (TextEditEventList == null || TextEditEvent.FontName == null || TextEditEvent.FontName == "")
|
|
{
|
|
{
|
|
var defaultlists = TextFont.GetPresetFontStyle();
|
|
var defaultlists = TextFont.GetPresetFontStyle();
|
|
-
|
|
|
|
- //var defaulItem = defaultlists.FirstOrDefault(temp => temp.mTag == CurrentPresetFont.ValueStr);
|
|
|
|
- //if (defaulItem != null)
|
|
|
|
- //{
|
|
|
|
- var currentItem = PresetFontList.FirstOrDefault(temp => temp.mTag == "Custom");
|
|
|
|
- if (currentItem != null)
|
|
|
|
- {
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- //currentItem.mTagContent = defaulItem.mTagContent;
|
|
|
|
- //currentItem.mFontStyle = defaulItem.mFontStyle;
|
|
|
|
- //currentItem.mFontWeight = defaulItem.mFontWeight;
|
|
|
|
- //currentItem.mFontFamily = defaulItem.mFontFamily;
|
|
|
|
- //currentItem.mFontSize = defaulItem.mFontSize;
|
|
|
|
- GetCurrentFontFamily(currentItem.mFontFamily.ToString(), currentItem.mFontFamily.ToString());
|
|
|
|
- GetCurrentFontSize(currentItem.mFontSize);
|
|
|
|
- GetFontWeights_Style(currentItem.mFontStyle, currentItem.mFontWeight);
|
|
|
|
- SelectedPresetFont();
|
|
|
|
-
|
|
|
|
- SelectColor = new SolidColorBrush(Colors.Black);
|
|
|
|
- CurrentFontSize = new ComboDataItem(currentItem.mFontSize);
|
|
|
|
|
|
+ var currentItem = PresetFontList.FirstOrDefault(temp => temp.mTag == "Custom");
|
|
|
|
+ if (currentItem != null)
|
|
|
|
+ {
|
|
|
|
+ SelectColor = new SolidColorBrush(Colors.Black);
|
|
|
|
+ CurrentFontSize = new ComboDataItem(currentItem.mFontSize);
|
|
CurrentPresetFont = new ComboDataItem(currentItem.mTag, currentItem.mTagContent);
|
|
CurrentPresetFont = new ComboDataItem(currentItem.mTag, currentItem.mTagContent);
|
|
CurrentFontFamily = new ComboDataItem(currentItem.mFontFamily.ToString(), currentItem.mFontFamily.ToString());
|
|
CurrentFontFamily = new ComboDataItem(currentItem.mFontFamily.ToString(), currentItem.mFontFamily.ToString());
|
|
- FontStyleItem = FontStyles.Normal;
|
|
|
|
- FontWeightItem = FontWeights.Normal;
|
|
|
|
-
|
|
|
|
- //}
|
|
|
|
-
|
|
|
|
- }
|
|
|
|
|
|
+ FontStyleItem = FontStyles.Normal;
|
|
|
|
+ FontWeightItem = FontWeights.Normal;
|
|
|
|
|
|
|
|
+ //GetCurrentFontFamily(currentItem.mFontFamily.ToString(), currentItem.mFontFamily.ToString());
|
|
|
|
+ if (GetCurrentFontFamily(currentItem) == false)
|
|
|
|
+ {
|
|
|
|
+ GetCurrentFontFamily(currentItem.mFontFamily.ToString(), currentItem.mFontFamily.ToString());
|
|
|
|
+ }
|
|
|
|
+ GetCurrentFontSize(currentItem.mFontSize);
|
|
|
|
+ GetFontWeights_Style(currentItem.mFontStyle, currentItem.mFontWeight);
|
|
|
|
+ SelectedPresetFont();
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
PDFViewer.PDFEditCommandHandler -= PDFViewer_PDFEditCommandHandler;
|
|
PDFViewer.PDFEditCommandHandler -= PDFViewer_PDFEditCommandHandler;
|
|
@@ -731,11 +770,27 @@ namespace PDF_Master.ViewModels.PropertyPanel.PDFEdit
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- //文本内容改变触发
|
|
|
|
|
|
+ private DefaultEditProperty GetEditDefault(ComPDFKit.PDFPage.CPDFEditType editType)
|
|
|
|
+ {
|
|
|
|
+ var edit = SettingHelper.GetPDFEditDefaultProperty(editType);
|
|
|
|
+ if (edit == null)
|
|
|
|
+ {
|
|
|
|
+ edit = new DefaultEditProperty();
|
|
|
|
+ edit.EditType = editType;
|
|
|
|
+ }
|
|
|
|
+ return edit;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /// <summary>
|
|
|
|
+ /// 文本内容改变触发
|
|
|
|
+ /// </summary>
|
|
|
|
+ /// <param name="sender"></param>
|
|
|
|
+ /// <param name="e"></param>
|
|
private void FontMode_ChangedValue(object sender, FontSetModeType e)
|
|
private void FontMode_ChangedValue(object sender, FontSetModeType e)
|
|
{
|
|
{
|
|
if (sender != null && TextEditEvent != null)
|
|
if (sender != null && TextEditEvent != null)
|
|
{
|
|
{
|
|
|
|
+ PDFEditEvent pdfEditEvent = PDFEditHelper.GetPDFEditDefaultProperty(out DefaultEditProperty defaultEdit, PDFViewer);
|
|
switch (e)
|
|
switch (e)
|
|
{
|
|
{
|
|
case FontSetModeType.PresetFontStyes:
|
|
case FontSetModeType.PresetFontStyes:
|
|
@@ -763,30 +818,44 @@ namespace PDF_Master.ViewModels.PropertyPanel.PDFEdit
|
|
itemlist.UpdatePDFEditByEventArgs();
|
|
itemlist.UpdatePDFEditByEventArgs();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+ defaultEdit.FontName = TextEditEvent.FontName;
|
|
|
|
+ defaultEdit.FontSize = TextEditEvent.FontSize;
|
|
|
|
+ defaultEdit.IsBold = TextEditEvent.IsBold;
|
|
|
|
+ defaultEdit.IsItalic = TextEditEvent.IsItalic;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
break;
|
|
break;
|
|
|
|
+
|
|
case FontSetModeType.FontFamilys:
|
|
case FontSetModeType.FontFamilys:
|
|
if (sender is string == true)
|
|
if (sender is string == true)
|
|
{
|
|
{
|
|
TextEditEvent.FontName = (string)sender;
|
|
TextEditEvent.FontName = (string)sender;
|
|
TextEditEvent.UpdatePDFEditByEventArgs();
|
|
TextEditEvent.UpdatePDFEditByEventArgs();
|
|
|
|
+
|
|
|
|
+ defaultEdit.FontName = TextEditEvent.FontName;
|
|
}
|
|
}
|
|
break;
|
|
break;
|
|
|
|
+
|
|
case FontSetModeType.FontSizes:
|
|
case FontSetModeType.FontSizes:
|
|
- if (sender is double == true && (double)sender > 0 && TextEditEvent.FontSize > 0)
|
|
|
|
|
|
+ if (sender is double == true && (double)sender > 0 && TextEditEvent.FontSize >= 0)
|
|
{
|
|
{
|
|
TextEditEvent.FontSize = (double)sender;
|
|
TextEditEvent.FontSize = (double)sender;
|
|
TextEditEvent.UpdatePDFEditByEventArgs();
|
|
TextEditEvent.UpdatePDFEditByEventArgs();
|
|
|
|
+
|
|
|
|
+ defaultEdit.FontSize = TextEditEvent.FontSize;
|
|
}
|
|
}
|
|
break;
|
|
break;
|
|
|
|
+
|
|
case FontSetModeType.FontWeight_Style:
|
|
case FontSetModeType.FontWeight_Style:
|
|
UpdateFontWeight_Style();
|
|
UpdateFontWeight_Style();
|
|
TextEditEvent.IsBold = FontWeightItem == FontWeights.Bold;
|
|
TextEditEvent.IsBold = FontWeightItem == FontWeights.Bold;
|
|
TextEditEvent.IsItalic = FontStyleItem == FontStyles.Italic;
|
|
TextEditEvent.IsItalic = FontStyleItem == FontStyles.Italic;
|
|
TextEditEvent.UpdatePDFEditByEventArgs();
|
|
TextEditEvent.UpdatePDFEditByEventArgs();
|
|
|
|
+
|
|
|
|
+ defaultEdit.IsBold = TextEditEvent.IsBold;
|
|
|
|
+ defaultEdit.IsItalic = TextEditEvent.IsItalic;
|
|
break;
|
|
break;
|
|
|
|
+
|
|
case FontSetModeType.FontColor:
|
|
case FontSetModeType.FontColor:
|
|
if (sender is Color == true)
|
|
if (sender is Color == true)
|
|
{
|
|
{
|
|
@@ -802,50 +871,70 @@ namespace PDF_Master.ViewModels.PropertyPanel.PDFEdit
|
|
TextEditEvent.UpdatePDFEditByEventArgs();
|
|
TextEditEvent.UpdatePDFEditByEventArgs();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+ defaultEdit.FontColor = TextEditEvent.FontColor;
|
|
break;
|
|
break;
|
|
|
|
|
|
case FontSetModeType.TextAlignment:
|
|
case FontSetModeType.TextAlignment:
|
|
break;
|
|
break;
|
|
-
|
|
|
|
}
|
|
}
|
|
|
|
+ PDFEditHelper.GetPDFEditEvent(defaultEdit, PDFViewer);
|
|
|
|
+ SettingHelper.SetPDFEditProperty(defaultEdit);
|
|
|
|
+ Settings.Default.Save();
|
|
}
|
|
}
|
|
-
|
|
|
|
}
|
|
}
|
|
|
|
|
|
//获取文本参数
|
|
//获取文本参数
|
|
private void GetPDFEdit()
|
|
private void GetPDFEdit()
|
|
{
|
|
{
|
|
|
|
+ DefaultEditProperty defaultEdit = SettingHelper.GetPDFEditDefaultProperty(CPDFEditType.EditText);
|
|
|
|
+ if (!App.IsGetTextFamily)
|
|
|
|
+ {
|
|
|
|
+ if (TextEditEvent.SystemFontNameList.Count > 0)
|
|
|
|
+ {
|
|
|
|
+ EditHelper.FontFamily = TextEditEvent.SystemFontNameList;
|
|
|
|
+ App.IsGetTextFamily = true;
|
|
|
|
+ }
|
|
|
|
+ InitBase_FontFamilys();
|
|
|
|
+ if (defaultEdit != null)
|
|
|
|
+ {
|
|
|
|
+ if (defaultEdit.SystemFontNameList.Count < EditHelper.FontFamily.Count)
|
|
|
|
+ {
|
|
|
|
+ defaultEdit.SystemFontNameList = EditHelper.FontFamily;
|
|
|
|
+ SettingHelper.SetPDFEditProperty(defaultEdit);
|
|
|
|
+ Settings.Default.Save();
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
|
|
SelectColor = new SolidColorBrush(TextEditEvent.FontColor);
|
|
SelectColor = new SolidColorBrush(TextEditEvent.FontColor);
|
|
- CurrentFontSize =new ComboDataItem(TextEditEvent.FontSize);
|
|
|
|
-
|
|
|
|
|
|
+ CurrentFontSize = new ComboDataItem(TextEditEvent.FontSize);
|
|
CurrentFontFamily = new ComboDataItem(TextEditEvent.FontName, TextEditEvent.FontName);
|
|
CurrentFontFamily = new ComboDataItem(TextEditEvent.FontName, TextEditEvent.FontName);
|
|
FontStyleItem = TextEditEvent.IsItalic ? FontStyles.Italic : FontStyles.Normal;
|
|
FontStyleItem = TextEditEvent.IsItalic ? FontStyles.Italic : FontStyles.Normal;
|
|
FontWeightItem = TextEditEvent.IsBold ? FontWeights.Bold : FontWeights.Normal;
|
|
FontWeightItem = TextEditEvent.IsBold ? FontWeights.Bold : FontWeights.Normal;
|
|
//GetCurrentFontFamily(TextEditEvent.FontName, TextEditEvent.FontName);
|
|
//GetCurrentFontFamily(TextEditEvent.FontName, TextEditEvent.FontName);
|
|
GetFontWeights_Style(FontStyleItem, FontWeightItem);
|
|
GetFontWeights_Style(FontStyleItem, FontWeightItem);
|
|
-
|
|
|
|
|
|
+
|
|
//判断样式列表中是否存在对应样式
|
|
//判断样式列表中是否存在对应样式
|
|
bool isExist = false;
|
|
bool isExist = false;
|
|
foreach (var item in PresetFontList)
|
|
foreach (var item in PresetFontList)
|
|
{
|
|
{
|
|
string itemmFontFamily = item.mFontFamily.Source;
|
|
string itemmFontFamily = item.mFontFamily.Source;
|
|
- if (item.mFontFamily.Source == "Arial")
|
|
|
|
- {
|
|
|
|
- itemmFontFamily = "Helvetica";
|
|
|
|
- }
|
|
|
|
- if (item.mFontFamily.Source == "Times-Roman" || itemmFontFamily == "Times")
|
|
|
|
|
|
+
|
|
|
|
+ if (item.mFontFamily.Source == "TimesRoman")
|
|
{
|
|
{
|
|
itemmFontFamily = "Times-Roman";
|
|
itemmFontFamily = "Times-Roman";
|
|
}
|
|
}
|
|
- if (item.mFontFamily.Source == "Courier")
|
|
|
|
|
|
+ if (defaultEdit != null && defaultEdit.SystemFontNameList != null)
|
|
{
|
|
{
|
|
- itemmFontFamily = "Courier New";
|
|
|
|
|
|
+ List<string> itemq = defaultEdit.SystemFontNameList.FindAll(p => p.Replace(" ", "").Equals(item.mFontFamily.ToString()));
|
|
|
|
+ if (itemq != null && itemq.Count > 0)
|
|
|
|
+ {
|
|
|
|
+ itemmFontFamily = itemq[0];
|
|
|
|
+ }
|
|
}
|
|
}
|
|
if (TextEditEvent.FontSize == item.mFontSize && TextEditEvent.IsBold == (item.mFontWeight == FontWeights.Bold) && TextEditEvent.IsItalic == (item.mFontStyle == FontStyles.Italic)
|
|
if (TextEditEvent.FontSize == item.mFontSize && TextEditEvent.IsBold == (item.mFontWeight == FontWeights.Bold) && TextEditEvent.IsItalic == (item.mFontStyle == FontStyles.Italic)
|
|
- && (TextEditEvent.FontName == itemmFontFamily || TextEditEvent.FontName == "Arial" && item.mFontFamily.Source == "Helvetica")
|
|
|
|
- )
|
|
|
|
|
|
+ && (TextEditEvent.FontName == itemmFontFamily || TextEditEvent.FontName == "Arial")
|
|
|
|
+ )
|
|
{
|
|
{
|
|
if (item.mTag != "Custom")
|
|
if (item.mTag != "Custom")
|
|
{
|
|
{
|
|
@@ -863,13 +952,18 @@ namespace PDF_Master.ViewModels.PropertyPanel.PDFEdit
|
|
CurrentPresetFont = new ComboDataItem("Custom", "Custom");
|
|
CurrentPresetFont = new ComboDataItem("Custom", "Custom");
|
|
GetCurrentFontSize((int)TextEditEvent.FontSize);
|
|
GetCurrentFontSize((int)TextEditEvent.FontSize);
|
|
|
|
|
|
- if (TextEditEvent.FontName == ""|| TextEditEvent.FontName == null)
|
|
|
|
|
|
+ if (TextEditEvent.FontName == "" || TextEditEvent.FontName == null)
|
|
{
|
|
{
|
|
- GetCurrentFontFamily("Helvetica", "Helvetica");
|
|
|
|
|
|
+ GetCurrentFontFamily("Arial", "Arial");
|
|
}
|
|
}
|
|
else
|
|
else
|
|
{
|
|
{
|
|
- GetCurrentFontFamily(TextEditEvent.FontName, TextEditEvent.FontName);
|
|
|
|
|
|
+ GetCurrentFontFamily(TextEditEvent.FontName.Replace(" ", ""), TextEditEvent.FontName);
|
|
|
|
+ //List<ComboDataItem> itemq = FontFamilyItems.FindAll(p => p.ValueStr == currentItem.mFontFamily.ToString());
|
|
|
|
+ //if (itemq != null && itemq.Count > 0)
|
|
|
|
+ //{
|
|
|
|
+ // GetCurrentFontFamily(TextEditEvent.FontName, itemq[0].Content);
|
|
|
|
+ //}
|
|
}
|
|
}
|
|
GetFontWeights_Style(TextEditEvent.IsItalic ? FontStyles.Italic : FontStyles.Normal, TextEditEvent.IsBold ? FontWeights.Bold : FontWeights.Normal);
|
|
GetFontWeights_Style(TextEditEvent.IsItalic ? FontStyles.Italic : FontStyles.Normal, TextEditEvent.IsBold ? FontWeights.Bold : FontWeights.Normal);
|
|
}
|
|
}
|
|
@@ -887,11 +981,13 @@ namespace PDF_Master.ViewModels.PropertyPanel.PDFEdit
|
|
GetCurrentFontSize(item.mFontSize);
|
|
GetCurrentFontSize(item.mFontSize);
|
|
if (item.mFontFamily != null)
|
|
if (item.mFontFamily != null)
|
|
{
|
|
{
|
|
- GetCurrentFontFamily(item.mFontFamily.ToString(), item.mFontFamily.ToString());
|
|
|
|
|
|
+ if (GetCurrentFontFamily(item) == false)
|
|
|
|
+ {
|
|
|
|
+ GetCurrentFontFamily(item.mFontFamily.ToString(), item.mFontFamily.ToString());
|
|
|
|
+ }
|
|
}
|
|
}
|
|
GetFontWeights_Style(TextEditEvent.IsItalic ? FontStyles.Italic : FontStyles.Normal, TextEditEvent.IsBold ? FontWeights.Bold : FontWeights.Normal);
|
|
GetFontWeights_Style(TextEditEvent.IsItalic ? FontStyles.Italic : FontStyles.Normal, TextEditEvent.IsBold ? FontWeights.Bold : FontWeights.Normal);
|
|
}
|
|
}
|
|
-
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -916,11 +1012,10 @@ namespace PDF_Master.ViewModels.PropertyPanel.PDFEdit
|
|
}
|
|
}
|
|
TextAlign = TextEditEvent.TextAlign;
|
|
TextAlign = TextEditEvent.TextAlign;
|
|
TextEditEvent.UpdatePDFEditByEventArgs();
|
|
TextEditEvent.UpdatePDFEditByEventArgs();
|
|
-
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- public bool IsNavigationTarget(NavigationContext navigationContext) { return true; }
|
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
+ public bool IsNavigationTarget(NavigationContext navigationContext)
|
|
|
|
+ { return true; }
|
|
|
|
|
|
public void OnNavigatedFrom(NavigationContext navigationContext)
|
|
public void OnNavigatedFrom(NavigationContext navigationContext)
|
|
{
|
|
{
|
|
@@ -931,6 +1026,5 @@ namespace PDF_Master.ViewModels.PropertyPanel.PDFEdit
|
|
PDFViewer.PDFEditCommandHandler -= PDFViewer_PDFEditCommandHandler;
|
|
PDFViewer.PDFEditCommandHandler -= PDFViewer_PDFEditCommandHandler;
|
|
ChangedValue -= FontMode_ChangedValue;
|
|
ChangedValue -= FontMode_ChangedValue;
|
|
}
|
|
}
|
|
-
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|