|
@@ -25,6 +25,7 @@ namespace PDF_Master.ViewModels.PropertyPanel.PDFEdit
|
|
|
|
|
|
public class TextEditPropertyViewModel : PDFEditVM, INavigationAware
|
|
public class TextEditPropertyViewModel : PDFEditVM, INavigationAware
|
|
{
|
|
{
|
|
|
|
+
|
|
#region
|
|
#region
|
|
private bool isSelectedEmpty;
|
|
private bool isSelectedEmpty;
|
|
public bool IsSelectedEmpty
|
|
public bool IsSelectedEmpty
|
|
@@ -32,6 +33,13 @@ namespace PDF_Master.ViewModels.PropertyPanel.PDFEdit
|
|
get { return isSelectedEmpty; }
|
|
get { return isSelectedEmpty; }
|
|
set { SetProperty(ref isSelectedEmpty, value); }
|
|
set { SetProperty(ref isSelectedEmpty, value); }
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ private String _CurrentColor;
|
|
|
|
+ public String CurrentColor
|
|
|
|
+ {
|
|
|
|
+ get { return _CurrentColor; }
|
|
|
|
+ set { SetProperty(ref _CurrentColor, 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
|
|
{
|
|
{
|
|
@@ -434,31 +442,32 @@ namespace PDF_Master.ViewModels.PropertyPanel.PDFEdit
|
|
{
|
|
{
|
|
case CommandType.Context:
|
|
case CommandType.Context:
|
|
|
|
|
|
-
|
|
|
|
- if (e.EditType == ComPDFKit.PDFPage.CPDFEditType.EditText)
|
|
|
|
- {
|
|
|
|
- //文字编辑
|
|
|
|
- if (e.PressOnBorder == true)
|
|
|
|
- {
|
|
|
|
- e.PopupMenu = SelectTextBorder(sender);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- else if(e.PressOnSelectedText == true)
|
|
|
|
- {
|
|
|
|
- e.PopupMenu = SelectTextContent(sender);
|
|
|
|
- }
|
|
|
|
|
|
|
|
- else if(e.SelectText=="")
|
|
|
|
- {
|
|
|
|
- e.PopupMenu= EditTextContent(sender);
|
|
|
|
- }
|
|
|
|
- else
|
|
|
|
- {
|
|
|
|
- e.PopupMenu = SelectTextContent(sender);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- }
|
|
|
|
- else if (e.EditType == ComPDFKit.PDFPage.CPDFEditType.None)
|
|
|
|
|
|
+ // if (e.EditType == ComPDFKit.PDFPage.CPDFEditType.EditText)
|
|
|
|
+ // {
|
|
|
|
+ // //文字编辑
|
|
|
|
+ // if (e.PressOnBorder == true)
|
|
|
|
+ // {
|
|
|
|
+ // e.PopupMenu = SelectTextBorder(sender);
|
|
|
|
+ // }
|
|
|
|
+
|
|
|
|
+ // else if(e.PressOnSelectedText == true)
|
|
|
|
+ // {
|
|
|
|
+ // e.PopupMenu = SelectTextContent(sender);
|
|
|
|
+ // }
|
|
|
|
+
|
|
|
|
+ // else if(e.SelectText=="")
|
|
|
|
+ // {
|
|
|
|
+ // e.PopupMenu= EditTextContent(sender);
|
|
|
|
+ // }
|
|
|
|
+ // else
|
|
|
|
+ // {
|
|
|
|
+ // e.PopupMenu = SelectTextContent(sender);
|
|
|
|
+ // }
|
|
|
|
+
|
|
|
|
+ // }
|
|
|
|
+ //else
|
|
|
|
+ if (e.EditType == ComPDFKit.PDFPage.CPDFEditType.None)
|
|
{
|
|
{
|
|
e.PopupMenu = SelectMoreText(sender);
|
|
e.PopupMenu = SelectMoreText(sender);
|
|
|
|
|
|
@@ -624,8 +633,15 @@ namespace PDF_Master.ViewModels.PropertyPanel.PDFEdit
|
|
private void GetPDFEdit()
|
|
private void GetPDFEdit()
|
|
{
|
|
{
|
|
if (TextEditEvent != null && TextEditEventList.Count == 1)
|
|
if (TextEditEvent != null && TextEditEventList.Count == 1)
|
|
- {
|
|
|
|
- SelectColor = new SolidColorBrush(TextEditEvent.FontColor);
|
|
|
|
|
|
+ { if(TextEditEvent.FontSize==0)
|
|
|
|
+ {
|
|
|
|
+ SelectColor = new SolidColorBrush(Colors.Black);
|
|
|
|
+ }
|
|
|
|
+ else
|
|
|
|
+ {
|
|
|
|
+ SelectColor = new SolidColorBrush(TextEditEvent.FontColor);
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
|
|
GetCurrentFontSize((int)TextEditEvent.FontSize);
|
|
GetCurrentFontSize((int)TextEditEvent.FontSize);
|
|
|
|
|