浏览代码

其他 - Form创建参数设置与部分崩溃问题处理

zhuyi 1 年之前
父节点
当前提交
ac7e50d6f3

+ 1 - 1
Demo/Examples/Compdfkit_Tools/Form/Property/ComboBoxProperty.xaml.cs

@@ -233,7 +233,7 @@ namespace Compdfkit_Tools.PDFControl
             if (IsLoadedData)
             {
                 CTextAttribute cTextAttribute = cPDFAnnotation.GetTextAttribute();
-                cTextAttribute.FontSize = (float)(sender as ComboBox).SelectedItem;
+                cTextAttribute.FontSize = Convert.ToSingle((sender as ComboBox).SelectedItem);
                 cPDFAnnotation.SetTextAttribute(cTextAttribute);
                 pdfViewerControl.PDFViewTool.GetCPDFViewer().UpDataAnnotFrame();
             }

+ 1 - 1
Demo/Examples/Compdfkit_Tools/Form/Property/ListBoxProperty.xaml.cs

@@ -236,7 +236,7 @@ namespace Compdfkit_Tools.PDFControl
             if (IsLoadedData)
             {
                 CTextAttribute cTextAttribute = cPDFAnnotation.GetTextAttribute();
-                cTextAttribute.FontSize = (float)(sender as ComboBox).SelectedItem;
+                cTextAttribute.FontSize = Convert.ToSingle((sender as ComboBox).SelectedItem);
                 cPDFAnnotation.SetTextAttribute(cTextAttribute);
                 pdfViewerControl.PDFViewTool.GetCPDFViewer().UpDataAnnotFrame();
             }

+ 5 - 2
Demo/Examples/Compdfkit_Tools/Form/Property/PushButtonProperty.xaml.cs

@@ -249,7 +249,7 @@ namespace Compdfkit_Tools.PDFControl
             if (IsLoadedData)
             {
                 CTextAttribute cTextAttribute = cPDFAnnotation.GetTextAttribute();
-                cTextAttribute.FontSize = (float)(sender as ComboBox).SelectedItem;
+                cTextAttribute.FontSize = Convert.ToSingle((sender as ComboBox).SelectedItem);
                 cPDFAnnotation.SetTextAttribute(cTextAttribute);
                 pdfViewerControl.PDFViewTool.GetCPDFViewer().UpDataAnnotFrame();
             }
@@ -331,7 +331,10 @@ namespace Compdfkit_Tools.PDFControl
 
         private void ActionContentText_TextChanged(object sender, TextChangedEventArgs e)
         {
-            AddAction();
+            if (IsLoadedData)
+            {
+                AddAction();
+            }
         }
     }
 }

+ 1 - 1
Demo/Examples/Compdfkit_Tools/Form/Property/TextFieldProperty.xaml.cs

@@ -225,7 +225,7 @@ namespace Compdfkit_Tools.PDFControl
             if (IsLoadedData)
             {
                 CTextAttribute cTextAttribute = cPDFAnnotation.GetTextAttribute();
-                cTextAttribute.FontSize = (float)(sender as ComboBox).SelectedItem;
+                cTextAttribute.FontSize = Convert.ToSingle((sender as ComboBox).SelectedItem);
                 cPDFAnnotation.SetTextAttribute(cTextAttribute);
                 pdfViewerControl.PDFViewTool.GetCPDFViewer().UpDataAnnotFrame();
             }

+ 1 - 1
Demo/Examples/Compdfkit_Tools/PDFView/RegularViewerControl.xaml.cs

@@ -99,7 +99,7 @@ namespace Compdfkit_Tools.PDFView
 
         private void InitialControl()
         {
-            PdfViewControl.PDFToolManager?.SetToolType(ComPDFKit.Tool.CPDFToolManager.ToolType.Viewer);
+            PdfViewControl.PDFToolManager?.SetToolType(ComPDFKit.Tool.CPDFToolManager.ToolType.Pan);
             //PdfViewControl.PDFView?.SetShowLink(true);
             PDFGrid.Child = PdfViewControl; 
             PdfViewControl.PDFViewTool.GetCPDFViewer().UndoManager.PropertyChanged -= UndoManager_PropertyChanged;

+ 1 - 1
Demo/Examples/PDFViewer/MainPage.xaml.cs

@@ -347,7 +347,7 @@ namespace PDFViewer
                 if (regularViewerControl.PdfViewControl != null)
                 {
                     PDFGrid.Child = regularViewerControl;
-                    viewControl.PDFToolManager.SetToolType(ComPDFKit.Tool.CPDFToolManager.ToolType.Viewer);
+                    viewControl.PDFToolManager.SetToolType(ComPDFKit.Tool.CPDFToolManager.ToolType.Pan);
                     //viewControl.PDFView.SetMouseMode(MouseModes.Viewer);
                     regularViewerControl.PdfViewControl = viewControl;
                     regularViewerControl.InitWithPDFViewer(viewControl);