|
@@ -23,22 +23,31 @@ namespace ComPDFKit.Controls.Edit
|
|
|
public CPDFViewerTool ToolView { get; private set; }
|
|
|
public TextEditParam EditEvent { get; set; }
|
|
|
|
|
|
- private bool _isMultiSelected;
|
|
|
|
|
|
public event PropertyChangedEventHandler PropertyChanged;
|
|
|
|
|
|
+ private bool _isMultiSelected;
|
|
|
public bool IsMultiSelected
|
|
|
- {
|
|
|
- get
|
|
|
+ {
|
|
|
+ get => _isMultiSelected;
|
|
|
+ set
|
|
|
{
|
|
|
- return _isMultiSelected;
|
|
|
+ if (UpdateProper(ref _isMultiSelected, value))
|
|
|
+ {
|
|
|
+ ToolView.GetCPDFViewer().UpdateRenderFrame();
|
|
|
+ }
|
|
|
}
|
|
|
+ }
|
|
|
+
|
|
|
+ private bool _showBorder;
|
|
|
+ public bool ShowBorder
|
|
|
+ {
|
|
|
+ get => _showBorder;
|
|
|
set
|
|
|
{
|
|
|
- UpdateProper(ref _isMultiSelected, value);
|
|
|
+ UpdateProper(ref _showBorder, value);
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
#endregion
|
|
|
|
|
|
public PDFTextEditControl()
|
|
@@ -46,6 +55,7 @@ namespace ComPDFKit.Controls.Edit
|
|
|
DataContext = this;
|
|
|
InitializeComponent();
|
|
|
Loaded += PDFTextEditControl_Loaded;
|
|
|
+
|
|
|
}
|
|
|
|
|
|
#region Init PDFView
|
|
@@ -58,7 +68,7 @@ namespace ComPDFKit.Controls.Edit
|
|
|
#region UI
|
|
|
public void SetPDFTextEditData(TextEditParam newEvent)
|
|
|
{
|
|
|
- if (newEvent.EditIndex<0)
|
|
|
+ if (newEvent.EditIndex < 0)
|
|
|
{
|
|
|
EditEvent = null;
|
|
|
}
|
|
@@ -277,6 +287,7 @@ namespace ComPDFKit.Controls.Edit
|
|
|
FontColorUI.ColorChanged += FontColorUI_ColorChanged;
|
|
|
|
|
|
IsMultiSelected = ToolView.GetIsMultiSelected();
|
|
|
+ ShowBorder = ToolView.GetEditPen() == null || ToolView.GetEditPen().Thickness != 0;
|
|
|
}
|
|
|
|
|
|
#endregion
|
|
@@ -303,7 +314,7 @@ namespace ComPDFKit.Controls.Edit
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- result = textArea.SetCharsFontSize((float)e,true);
|
|
|
+ result = textArea.SetCharsFontSize((float)e, true);
|
|
|
}
|
|
|
|
|
|
if (result)
|
|
@@ -361,7 +372,7 @@ namespace ComPDFKit.Controls.Edit
|
|
|
result = textArea.SetCharsFontColor(newBrush.Color.R, newBrush.Color.G, newBrush.Color.B);
|
|
|
}
|
|
|
|
|
|
- if(result)
|
|
|
+ if (result)
|
|
|
{
|
|
|
PDFEditHistory editHistory = new PDFEditHistory();
|
|
|
editHistory.EditPage = editPage;
|
|
@@ -652,12 +663,31 @@ namespace ComPDFKit.Controls.Edit
|
|
|
}
|
|
|
}
|
|
|
#endregion
|
|
|
-
|
|
|
+
|
|
|
private void chkMulti_Click(object sender, RoutedEventArgs e)
|
|
|
{
|
|
|
ToolView.SetIsMultiSelected((e.Source as CheckBox).IsChecked.GetValueOrDefault());
|
|
|
}
|
|
|
|
|
|
+ private void chkEditPen_Click(object sender, RoutedEventArgs e)
|
|
|
+ {
|
|
|
+ if ((e.Source as CheckBox).IsChecked.GetValueOrDefault())
|
|
|
+ {
|
|
|
+ ToolView.SetEditPen(null);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ ToolView.SetEditPen(new Pen()
|
|
|
+ {
|
|
|
+ Brush = new SolidColorBrush(Colors.Black),
|
|
|
+ Thickness = 0
|
|
|
+ });
|
|
|
+ }
|
|
|
+ ShowBorder = ToolView.GetEditPen() == null || ToolView.GetEditPen().Thickness != 0;
|
|
|
+
|
|
|
+ ToolView.GetCPDFViewer().UpdateRenderFrame();
|
|
|
+ }
|
|
|
+
|
|
|
protected bool UpdateProper<T>(ref T properValue,
|
|
|
T newValue,
|
|
|
[CallerMemberName] string properName = "")
|