|
@@ -46,7 +46,7 @@ namespace PDF_Master.ViewModels.PropertyPanel.AnnotPanel
|
|
|
SetProperty(ref T_font, value);
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
private string T_fill;
|
|
|
|
|
|
public string T_Fill
|
|
@@ -58,7 +58,6 @@ namespace PDF_Master.ViewModels.PropertyPanel.AnnotPanel
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-
|
|
|
private void InitString()
|
|
|
{
|
|
|
T_Title = App.MainPageLoader.GetString("FreeText_Title");
|
|
@@ -66,9 +65,10 @@ namespace PDF_Master.ViewModels.PropertyPanel.AnnotPanel
|
|
|
T_Fill = App.MainPageLoader.GetString("FreeText_Fill");
|
|
|
}
|
|
|
|
|
|
- #endregion
|
|
|
+ #endregion 文案
|
|
|
|
|
|
private FontBoardVm _fontVm = new FontBoardVm(true);
|
|
|
+
|
|
|
public FontBoardVm FontVm
|
|
|
{
|
|
|
get { return _fontVm; }
|
|
@@ -76,6 +76,7 @@ namespace PDF_Master.ViewModels.PropertyPanel.AnnotPanel
|
|
|
}
|
|
|
|
|
|
private AnnotCommon _basicVm = new AnnotCommon();
|
|
|
+
|
|
|
public AnnotCommon BasicVm
|
|
|
{
|
|
|
get { return _basicVm; }
|
|
@@ -83,6 +84,7 @@ namespace PDF_Master.ViewModels.PropertyPanel.AnnotPanel
|
|
|
}
|
|
|
|
|
|
private bool _isFillFreeText = false;
|
|
|
+
|
|
|
public bool IsFillFreeTextAnnot
|
|
|
{
|
|
|
get { return _isFillFreeText; }
|
|
@@ -90,6 +92,7 @@ namespace PDF_Master.ViewModels.PropertyPanel.AnnotPanel
|
|
|
}
|
|
|
|
|
|
private bool _isCheckedTime = false;
|
|
|
+
|
|
|
public bool IsCheckedTime
|
|
|
{
|
|
|
get { return _isCheckedTime; }
|
|
@@ -97,13 +100,13 @@ namespace PDF_Master.ViewModels.PropertyPanel.AnnotPanel
|
|
|
}
|
|
|
|
|
|
private ComboDataItem _currrentDateFormat = new ComboDataItem("M/d", "format");
|
|
|
+
|
|
|
public ComboDataItem CurrrentDateFormat
|
|
|
{
|
|
|
get { return _currrentDateFormat; }
|
|
|
set => SetProperty(ref _currrentDateFormat, value);
|
|
|
}
|
|
|
|
|
|
-
|
|
|
public List<ComboDataItem> DateFormatItems { get; private set; }
|
|
|
|
|
|
public AnnotAttribEvent AnnotEvent { get; set; }
|
|
@@ -115,10 +118,9 @@ namespace PDF_Master.ViewModels.PropertyPanel.AnnotPanel
|
|
|
public DelegateCommand FontStyleWeightChangedCommand { get; set; }
|
|
|
|
|
|
public DelegateCommand<object> SelectedFillOpacityCommand { get; set; }
|
|
|
-
|
|
|
+
|
|
|
public DelegateCommand<object> SelectedColorCommand { get; set; }
|
|
|
public DelegateCommand<object> SelectedFillColorCommand { get; set; }
|
|
|
-
|
|
|
|
|
|
public DelegateCommand FontSizeChangedCommand { get; set; }
|
|
|
public DelegateCommand<object> TextAlignCheckedCommand { get; set; }
|
|
@@ -171,14 +173,12 @@ namespace PDF_Master.ViewModels.PropertyPanel.AnnotPanel
|
|
|
InitVariable();
|
|
|
}
|
|
|
|
|
|
-
|
|
|
private void InitVariable()
|
|
|
{
|
|
|
DateFormatItems = new List<ComboDataItem>();
|
|
|
DateFormatItems = TextFont.GetDateFormats();
|
|
|
UpdateDateFormatLists();
|
|
|
InitFillColorItems();
|
|
|
-
|
|
|
}
|
|
|
|
|
|
private void InitFillColorItems()
|
|
@@ -206,8 +206,6 @@ namespace PDF_Master.ViewModels.PropertyPanel.AnnotPanel
|
|
|
CurrrentDateFormat = new ComboDataItem(CurrrentDateFormat.ValueStr, CurrrentDateFormat.Content);
|
|
|
}
|
|
|
|
|
|
-
|
|
|
-
|
|
|
private void TextAlignChecked(object obj)
|
|
|
{
|
|
|
if ((string)obj != null)
|
|
@@ -234,13 +232,12 @@ namespace PDF_Master.ViewModels.PropertyPanel.AnnotPanel
|
|
|
PropertyPanel.UpdateAnnotAAttrib(AnnotAttrib.TextAlign, TextAlignment.Justify);
|
|
|
break;
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
}
|
|
|
|
|
|
private void LineMode_Checked(object obj)
|
|
|
{
|
|
|
- if(obj != null)
|
|
|
+ if (obj != null)
|
|
|
{
|
|
|
var tag = ((string)obj);
|
|
|
switch (tag)
|
|
@@ -252,12 +249,11 @@ namespace PDF_Master.ViewModels.PropertyPanel.AnnotPanel
|
|
|
case "Solid":
|
|
|
AnnotEvent?.UpdateAttrib(AnnotAttrib.LineStyle, DashStyles.Solid);
|
|
|
break;
|
|
|
-
|
|
|
}
|
|
|
AnnotEvent?.UpdateAnnot();
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
//从预设样式设置文本
|
|
|
private void SelectedPresetFont()
|
|
|
{
|
|
@@ -271,7 +267,9 @@ namespace PDF_Master.ViewModels.PropertyPanel.AnnotPanel
|
|
|
FontVm.GetCurrentFontSize(item.mFontSize);
|
|
|
|
|
|
if (item.mFontFamily != null)
|
|
|
+ {
|
|
|
FontVm.GetCurrentFontFamily(item.mFontFamily.ToString(), item.mFontFamily.ToString());
|
|
|
+ }
|
|
|
|
|
|
FontVm.GetFontWeights_Style(item.mFontStyle, item.mFontWeight);
|
|
|
|
|
@@ -288,7 +286,7 @@ namespace PDF_Master.ViewModels.PropertyPanel.AnnotPanel
|
|
|
//设置文本字重、样式
|
|
|
private void FontStyleWeightChanged()
|
|
|
{
|
|
|
- if(FontVm.CurrrentFontWeightStyle != null)
|
|
|
+ if (FontVm.CurrrentFontWeightStyle != null)
|
|
|
{
|
|
|
FontVm.UpdateFontWeight_Style();
|
|
|
|
|
@@ -298,7 +296,6 @@ namespace PDF_Master.ViewModels.PropertyPanel.AnnotPanel
|
|
|
PropertyPanel.UpdateAnnotAllAttribs(AnnotAttribDir);
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
|
|
|
private void SelectedFillOpacity(object obj)
|
|
|
{
|
|
@@ -319,7 +316,7 @@ namespace PDF_Master.ViewModels.PropertyPanel.AnnotPanel
|
|
|
PropertyPanel.UpdateAnnotAAttrib(AnnotAttrib.Transparency, BasicVm.FillOpacity);
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
//设置字体大小
|
|
|
private void FontSizeChanged()
|
|
|
{
|
|
@@ -386,7 +383,6 @@ namespace PDF_Master.ViewModels.PropertyPanel.AnnotPanel
|
|
|
menu.IsOpen = true;
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
|
|
|
private ContextMenu SelectAnnotContextMenu(bool isEnable)
|
|
@@ -407,9 +403,9 @@ namespace PDF_Master.ViewModels.PropertyPanel.AnnotPanel
|
|
|
}
|
|
|
|
|
|
public List<PresetFontItem> FontStyleList = new List<PresetFontItem>();
|
|
|
+
|
|
|
private void ReDefineFontStyle()
|
|
|
{
|
|
|
-
|
|
|
var item = FontVm.PresetFontList.FirstOrDefault(temp => temp.mTag == FontVm.CurrentPresetFont.ValueStr);
|
|
|
if (item == null) return;
|
|
|
|
|
@@ -437,7 +433,7 @@ namespace PDF_Master.ViewModels.PropertyPanel.AnnotPanel
|
|
|
private void RestoreDefaultStyle()
|
|
|
{
|
|
|
var defaultlists = TextFont.GetPresetFontStyle();
|
|
|
- if(FontVm.CurrentPresetFont.ValueStr != "custom")
|
|
|
+ if (FontVm.CurrentPresetFont.ValueStr != "custom")
|
|
|
{
|
|
|
var defaulItem = defaultlists.FirstOrDefault(temp => temp.mTag == FontVm.CurrentPresetFont.ValueStr);
|
|
|
if (defaulItem != null)
|
|
@@ -456,19 +452,17 @@ namespace PDF_Master.ViewModels.PropertyPanel.AnnotPanel
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
|
|
|
private void DateFormatChanged()
|
|
|
{
|
|
|
- if(CurrrentDateFormat != null)
|
|
|
+ if (CurrrentDateFormat != null)
|
|
|
{
|
|
|
if (IsCheckedTime)
|
|
|
UpdateDateFormatLists();
|
|
|
|
|
|
PropertyPanel.UpdateAnnotAAttrib(AnnotAttrib.NoteText, CurrrentDateFormat.Content);
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
|
|
|
private void ShowTimeCheckedChnaged()
|
|
@@ -480,7 +474,6 @@ namespace PDF_Master.ViewModels.PropertyPanel.AnnotPanel
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-
|
|
|
public bool IsNavigationTarget(NavigationContext navigationContext)
|
|
|
{
|
|
|
return true;
|
|
@@ -489,7 +482,7 @@ namespace PDF_Master.ViewModels.PropertyPanel.AnnotPanel
|
|
|
public void OnNavigatedFrom(NavigationContext navigationContext)
|
|
|
{
|
|
|
BasicVm.IsMultiSelected = false;
|
|
|
- // IsCheckedTime = false;
|
|
|
+ // IsCheckedTime = false;
|
|
|
}
|
|
|
|
|
|
public void OnNavigatedTo(NavigationContext navigationContext)
|
|
@@ -497,7 +490,6 @@ namespace PDF_Master.ViewModels.PropertyPanel.AnnotPanel
|
|
|
navigationContext.Parameters.TryGetValue<AnnotTransfer>(ParameterNames.PropertyPanelContentViewModel, out PropertyPanel);
|
|
|
if (PropertyPanel != null)
|
|
|
{
|
|
|
-
|
|
|
AnnotEvent = PropertyPanel.AnnotEvent;
|
|
|
Annot = PropertyPanel.annot as FreeTextAnnotArgs;
|
|
|
LoadPropertyHandler?.Invoke(this, Annot);
|
|
@@ -518,9 +510,9 @@ namespace PDF_Master.ViewModels.PropertyPanel.AnnotPanel
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- /// <summary>
|
|
|
- /// 多选的注释
|
|
|
- /// </summary>
|
|
|
+ /// <summary>
|
|
|
+ /// 多选的注释
|
|
|
+ /// </summary>
|
|
|
private List<FreeTextAnnotArgs> ConvertLists()
|
|
|
{
|
|
|
List<FreeTextAnnotArgs> FreeTextLists = new List<FreeTextAnnotArgs>();
|
|
@@ -538,6 +530,7 @@ namespace PDF_Master.ViewModels.PropertyPanel.AnnotPanel
|
|
|
else
|
|
|
return FreeTextLists;
|
|
|
}
|
|
|
+
|
|
|
private void IsAttributeEquals()
|
|
|
{
|
|
|
var list = ConvertLists();
|
|
@@ -563,7 +556,6 @@ namespace PDF_Master.ViewModels.PropertyPanel.AnnotPanel
|
|
|
FontVm.StrTextAlign = "None";
|
|
|
}
|
|
|
|
|
|
-
|
|
|
if (temp.FontFamily != item.FontFamily)
|
|
|
{
|
|
|
isNoEqualsDir["FontFamily"] = true;
|
|
@@ -604,8 +596,6 @@ namespace PDF_Master.ViewModels.PropertyPanel.AnnotPanel
|
|
|
isNoEqualsDir["FillColor"] = true;
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
}
|
|
|
|
|
|
////以下是多选注释的属性相等时
|
|
@@ -617,7 +607,6 @@ namespace PDF_Master.ViewModels.PropertyPanel.AnnotPanel
|
|
|
if (isNoEqualsDir["FontFamily"] == false)
|
|
|
{
|
|
|
FontVm.GetCurrentFontFamily(temp.FontFamily.ToString(), temp.FontFamily.ToString());
|
|
|
-
|
|
|
}
|
|
|
|
|
|
if (isNoEqualsDir["FontSize"] == false)
|
|
@@ -629,19 +618,16 @@ namespace PDF_Master.ViewModels.PropertyPanel.AnnotPanel
|
|
|
{
|
|
|
FontVm.GetFontWeights_Style(temp.FontStyle, temp.FontWeight);
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
if (isNoEqualsDir["FontColor"] == false)
|
|
|
{
|
|
|
FontVm.FontColor = new SolidColorBrush(temp.FontColor);
|
|
|
-
|
|
|
}
|
|
|
|
|
|
if (isNoEqualsDir["FillColor"] == false)
|
|
|
{
|
|
|
FontVm.FontColor = new SolidColorBrush(temp.BgColor);
|
|
|
-
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -652,6 +638,7 @@ namespace PDF_Master.ViewModels.PropertyPanel.AnnotPanel
|
|
|
|
|
|
FontVm.FontColor = new SolidColorBrush(Annot.FontColor);
|
|
|
FontVm.GetCurrentFontSize((int)Annot.FontSize);
|
|
|
+ FontVm.GetCurrentPresetFont(Annot);
|
|
|
FontVm.GetCurrentFontFamily(Annot.FontFamily.ToString(), Annot.FontFamily.ToString());
|
|
|
FontVm.GetFontWeights_Style(Annot.FontStyle, Annot.FontWeight);
|
|
|
|
|
@@ -665,7 +652,7 @@ namespace PDF_Master.ViewModels.PropertyPanel.AnnotPanel
|
|
|
if (IsFillFreeTextAnnot == false)
|
|
|
return;
|
|
|
|
|
|
- if(string.IsNullOrEmpty(Annot.TextContent))
|
|
|
+ if (string.IsNullOrEmpty(Annot.TextContent))
|
|
|
{
|
|
|
if (CurrrentDateFormat != null)
|
|
|
{
|
|
@@ -675,7 +662,6 @@ namespace PDF_Master.ViewModels.PropertyPanel.AnnotPanel
|
|
|
PropertyPanel.UpdateAnnotAAttrib(AnnotAttrib.NoteText, CurrrentDateFormat.Content);
|
|
|
}
|
|
|
return;
|
|
|
-
|
|
|
}
|
|
|
DateTime dtDate;
|
|
|
bool isTime = false;
|
|
@@ -703,17 +689,14 @@ namespace PDF_Master.ViewModels.PropertyPanel.AnnotPanel
|
|
|
{
|
|
|
string stadate = System.DateTime.Now.ToString(strFormat);
|
|
|
item.SetContent(stadate);
|
|
|
-
|
|
|
}
|
|
|
|
|
|
CurrrentDateFormat = new ComboDataItem(item.ValueStr, item.Content);
|
|
|
|
|
|
break;
|
|
|
-
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-
|
|
|
IsCheckedTime = isTime;
|
|
|
}
|
|
|
|
|
@@ -725,19 +708,23 @@ namespace PDF_Master.ViewModels.PropertyPanel.AnnotPanel
|
|
|
case TextAlignment.Left:
|
|
|
FontVm.StrTextAlign = "Left";
|
|
|
break;
|
|
|
+
|
|
|
case TextAlignment.Center:
|
|
|
FontVm.StrTextAlign = "Center";
|
|
|
break;
|
|
|
+
|
|
|
case TextAlignment.Right:
|
|
|
FontVm.StrTextAlign = "Right";
|
|
|
break;
|
|
|
+
|
|
|
case TextAlignment.Justify:
|
|
|
FontVm.StrTextAlign = "Justify";
|
|
|
break;
|
|
|
+
|
|
|
default:
|
|
|
FontVm.StrTextAlign = "None";
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-}
|
|
|
+}
|