|
@@ -49,7 +49,7 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
|
|
public DelegateCommand<object> SelectedFillColorCommand { get; set; }
|
|
public DelegateCommand<object> SelectedFillColorCommand { get; set; }
|
|
|
|
|
|
|
|
|
|
- public DelegateCommand<object> FontSizeChangedCommand { get; set; }
|
|
|
|
|
|
+ public DelegateCommand FontSizeChangedCommand { get; set; }
|
|
public DelegateCommand<object> TextAlignCheckedCommand { get; set; }
|
|
public DelegateCommand<object> TextAlignCheckedCommand { get; set; }
|
|
public DelegateCommand<object> LineModeCheckedCommand { get; set; }
|
|
public DelegateCommand<object> LineModeCheckedCommand { get; set; }
|
|
public DelegateCommand<object> SelectedOpacityValueCommand { get; set; }
|
|
public DelegateCommand<object> SelectedOpacityValueCommand { get; set; }
|
|
@@ -69,7 +69,7 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
|
|
//文本字重、字体
|
|
//文本字重、字体
|
|
FontStyleWeightChangedCommand = new DelegateCommand(FontStyleWeightChanged);
|
|
FontStyleWeightChangedCommand = new DelegateCommand(FontStyleWeightChanged);
|
|
//字体
|
|
//字体
|
|
- FontFamilyChangedCommand = new DelegateCommand(FontFamilyChanged_Command);
|
|
|
|
|
|
+ FontFamilyChangedCommand = new DelegateCommand(FontFamilyChanged);
|
|
//自定义
|
|
//自定义
|
|
CustomFontStyleCommand = new DelegateCommand(CustomFontStyle);
|
|
CustomFontStyleCommand = new DelegateCommand(CustomFontStyle);
|
|
//重新定义
|
|
//重新定义
|
|
@@ -80,9 +80,9 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
|
|
SelectedFillOpacityCommand = new DelegateCommand<object>(SelectedFillOpacity);
|
|
SelectedFillOpacityCommand = new DelegateCommand<object>(SelectedFillOpacity);
|
|
|
|
|
|
SelectedColorCommand = new DelegateCommand<object>(SelectedColor_Command);
|
|
SelectedColorCommand = new DelegateCommand<object>(SelectedColor_Command);
|
|
- SelectedFillColorCommand = new DelegateCommand<object>(SelectedFillColor_Command);
|
|
|
|
|
|
+ SelectedFillColorCommand = new DelegateCommand<object>(SelectedFillColorChange);
|
|
|
|
|
|
- FontSizeChangedCommand = new DelegateCommand<object>(FontSizeChanged_Command);
|
|
|
|
|
|
+ FontSizeChangedCommand = new DelegateCommand(FontSizeChanged);
|
|
TextAlignCheckedCommand = new DelegateCommand<object>(TextAlignChecked);
|
|
TextAlignCheckedCommand = new DelegateCommand<object>(TextAlignChecked);
|
|
LineModeCheckedCommand = new DelegateCommand<object>(LineMode_Checked);
|
|
LineModeCheckedCommand = new DelegateCommand<object>(LineMode_Checked);
|
|
SelectedOpacityValueCommand = new DelegateCommand<object>(SelectedOpacityValue);
|
|
SelectedOpacityValueCommand = new DelegateCommand<object>(SelectedOpacityValue);
|
|
@@ -105,25 +105,25 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
|
|
switch ((string)obj)
|
|
switch ((string)obj)
|
|
{
|
|
{
|
|
case "AlignLeft":
|
|
case "AlignLeft":
|
|
- AnnotEvent?.UpdateAttrib(AnnotAttrib.TextAlign, TextAlignment.Left);
|
|
|
|
|
|
+ PropertyPanel.UpdateAnnotAAttrib(AnnotAttrib.TextAlign, TextAlignment.Left);
|
|
break;
|
|
break;
|
|
|
|
|
|
case "AlignCenter":
|
|
case "AlignCenter":
|
|
- AnnotEvent?.UpdateAttrib(AnnotAttrib.TextAlign, TextAlignment.Center);
|
|
|
|
|
|
+ PropertyPanel.UpdateAnnotAAttrib(AnnotAttrib.TextAlign, TextAlignment.Center);
|
|
break;
|
|
break;
|
|
|
|
|
|
case "AlignRight":
|
|
case "AlignRight":
|
|
- AnnotEvent?.UpdateAttrib(AnnotAttrib.TextAlign, TextAlignment.Right);
|
|
|
|
|
|
+ PropertyPanel.UpdateAnnotAAttrib(AnnotAttrib.TextAlign, TextAlignment.Right);
|
|
break;
|
|
break;
|
|
|
|
|
|
case "Justify":
|
|
case "Justify":
|
|
- AnnotEvent?.UpdateAttrib(AnnotAttrib.TextAlign, TextAlignment.Justify);
|
|
|
|
|
|
+ PropertyPanel.UpdateAnnotAAttrib(AnnotAttrib.TextAlign, TextAlignment.Justify);
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
|
|
|
|
- AnnotEvent?.UpdateAnnot();
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+
|
|
private void LineMode_Checked(object obj)
|
|
private void LineMode_Checked(object obj)
|
|
{
|
|
{
|
|
if(obj != null)
|
|
if(obj != null)
|
|
@@ -158,11 +158,12 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
|
|
FontVm.GetCurrentFontFamily(item.mFontFamily.ToString(), item.mFontFamily.ToString());
|
|
FontVm.GetCurrentFontFamily(item.mFontFamily.ToString(), item.mFontFamily.ToString());
|
|
FontVm.GetFontWeights_Style(item.mFontStyle, item.mFontWeight);
|
|
FontVm.GetFontWeights_Style(item.mFontStyle, item.mFontWeight);
|
|
|
|
|
|
- AnnotEvent?.UpdateAttrib(AnnotAttrib.FontSize, item.mFontSize);
|
|
|
|
- AnnotEvent?.UpdateAttrib(AnnotAttrib.FontFamily, item.mFontFamily);
|
|
|
|
- AnnotEvent?.UpdateAttrib(AnnotAttrib.FontStyle, item.mFontStyle);
|
|
|
|
- AnnotEvent?.UpdateAttrib(AnnotAttrib.FontWeight, item.mFontWeight);
|
|
|
|
- AnnotEvent?.UpdateAnnot();
|
|
|
|
|
|
+ Dictionary<AnnotAttrib, object> AnnotAttribDir = new Dictionary<AnnotAttrib, object>();
|
|
|
|
+ AnnotAttribDir.Add(AnnotAttrib.FontSize, item.mFontSize);
|
|
|
|
+ AnnotAttribDir.Add(AnnotAttrib.FontFamily, item.mFontFamily);
|
|
|
|
+ AnnotAttribDir.Add(AnnotAttrib.FontStyle, item.mFontStyle);
|
|
|
|
+ AnnotAttribDir.Add(AnnotAttrib.FontWeight, item.mFontWeight);
|
|
|
|
+ PropertyPanel.UpdateAnnotAllAttribs(AnnotAttribDir);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -173,9 +174,11 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
|
|
if(FontVm.CurrrentFontWeightStyle != null)
|
|
if(FontVm.CurrrentFontWeightStyle != null)
|
|
{
|
|
{
|
|
FontVm.UpdateFontWeight_Style();
|
|
FontVm.UpdateFontWeight_Style();
|
|
- AnnotEvent?.UpdateAttrib(AnnotAttrib.FontStyle, FontVm.FontWeightItem);
|
|
|
|
- AnnotEvent?.UpdateAttrib(AnnotAttrib.FontWeight, FontVm.FontStyleItem);
|
|
|
|
- AnnotEvent?.UpdateAnnot();
|
|
|
|
|
|
+
|
|
|
|
+ Dictionary<AnnotAttrib, object> AnnotAttribDir = new Dictionary<AnnotAttrib, object>();
|
|
|
|
+ AnnotAttribDir.Add(AnnotAttrib.FontStyle, FontVm.FontWeightItem);
|
|
|
|
+ AnnotAttribDir.Add(AnnotAttrib.FontWeight, FontVm.FontStyleItem);
|
|
|
|
+ PropertyPanel.UpdateAnnotAllAttribs(AnnotAttribDir);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -204,43 +207,34 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- private void FontSizeChanged_Command(object obj)
|
|
|
|
|
|
+ //设置字体大小
|
|
|
|
+ private void FontSizeChanged()
|
|
{
|
|
{
|
|
- if (obj != null)
|
|
|
|
|
|
+ if (FontVm.CurrentFontSize != null)
|
|
{
|
|
{
|
|
- var item = (ComboBoxItem)obj;
|
|
|
|
- var content = (string)item.Content;
|
|
|
|
- if (content != null)
|
|
|
|
- {
|
|
|
|
- var intData = int.Parse(content);
|
|
|
|
- AnnotEvent?.UpdateAttrib(AnnotAttrib.FontSize, intData);
|
|
|
|
-
|
|
|
|
- AnnotEvent?.UpdateAnnot();
|
|
|
|
- }
|
|
|
|
|
|
+ PropertyPanel.UpdateAnnotAAttrib(AnnotAttrib.FontSize, FontVm.CurrentFontSize.Value);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- private void FontFamilyChanged_Command()
|
|
|
|
|
|
+ //设置字体样式
|
|
|
|
+ private void FontFamilyChanged()
|
|
{
|
|
{
|
|
if (string.IsNullOrEmpty(FontVm.CurrentFontFamily.ValueStr) == false)
|
|
if (string.IsNullOrEmpty(FontVm.CurrentFontFamily.ValueStr) == false)
|
|
{
|
|
{
|
|
- AnnotEvent?.UpdateAttrib(AnnotAttrib.FontFamily, new FontFamily(FontVm.CurrentFontFamily.ValueStr));
|
|
|
|
- AnnotEvent?.UpdateAnnot();
|
|
|
|
|
|
+ PropertyPanel.UpdateAnnotAAttrib(AnnotAttrib.FontFamily, new FontFamily(FontVm.CurrentFontFamily.ValueStr));
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- private void SelectedFillColor_Command(object obj)
|
|
|
|
|
|
+ private void SelectedFillColorChange(object obj)
|
|
{
|
|
{
|
|
if (obj != null)
|
|
if (obj != null)
|
|
{
|
|
{
|
|
var colorValue = (Color)obj;
|
|
var colorValue = (Color)obj;
|
|
if (colorValue != null)
|
|
if (colorValue != null)
|
|
{
|
|
{
|
|
-
|
|
|
|
BasicVm.FillColor = new SolidColorBrush(colorValue);
|
|
BasicVm.FillColor = new SolidColorBrush(colorValue);
|
|
|
|
+ PropertyPanel.UpdateAnnotAAttrib(AnnotAttrib.FillColor, colorValue);
|
|
// BasicVm.FillColor.Opacity = BasicVmFillOpacity;
|
|
// BasicVm.FillColor.Opacity = BasicVmFillOpacity;
|
|
- AnnotEvent?.UpdateAttrib(AnnotAttrib.FillColor, colorValue);
|
|
|
|
- AnnotEvent?.UpdateAnnot();
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|