|
@@ -84,33 +84,39 @@ namespace ComPDFKit.Controls.Measure
|
|
switch (param.CurrentType)
|
|
switch (param.CurrentType)
|
|
{
|
|
{
|
|
case C_ANNOTATION_TYPE.C_ANNOTATION_LINE:
|
|
case C_ANNOTATION_TYPE.C_ANNOTATION_LINE:
|
|
-
|
|
|
|
- if (param is LineMeasureParam lineMeasureParam)
|
|
|
|
{
|
|
{
|
|
- straightnessProperty.SetAnnotParam(lineMeasureParam, annot, viewControl);
|
|
|
|
|
|
+ if (param is LineMeasureParam lineMeasureParam)
|
|
|
|
+ {
|
|
|
|
+ straightnessProperty.SetAnnotParam(lineMeasureParam, annot, viewControl);
|
|
|
|
+ SetMeasurePanel(straightnessProperty);
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
-
|
|
|
|
- currentPanel = straightnessProperty;
|
|
|
|
-
|
|
|
|
break;
|
|
break;
|
|
|
|
+
|
|
case C_ANNOTATION_TYPE.C_ANNOTATION_POLYLINE:
|
|
case C_ANNOTATION_TYPE.C_ANNOTATION_POLYLINE:
|
|
if (param is PolyLineMeasureParam polyLineMeasureParam)
|
|
if (param is PolyLineMeasureParam polyLineMeasureParam)
|
|
{
|
|
{
|
|
multilineProperty.SetAnnotParam(polyLineMeasureParam, annot, viewControl);
|
|
multilineProperty.SetAnnotParam(polyLineMeasureParam, annot, viewControl);
|
|
|
|
+ SetMeasurePanel(multilineProperty);
|
|
|
|
+ return;
|
|
}
|
|
}
|
|
- currentPanel = multilineProperty;
|
|
|
|
break;
|
|
break;
|
|
|
|
+
|
|
case C_ANNOTATION_TYPE.C_ANNOTATION_POLYGON:
|
|
case C_ANNOTATION_TYPE.C_ANNOTATION_POLYGON:
|
|
- if (param is PolygonMeasureParam polygonMeasureParam)
|
|
|
|
|
|
+ if (param is PolygonMeasureParam polygonMeasureParam && (annot ==null || (annot as CPDFPolygonAnnotation).IsMeasured()))
|
|
{
|
|
{
|
|
polygonProperty.SetAnnotParam(polygonMeasureParam, annot, viewControl);
|
|
polygonProperty.SetAnnotParam(polygonMeasureParam, annot, viewControl);
|
|
|
|
+ SetMeasurePanel(polygonProperty);
|
|
|
|
+ return;
|
|
}
|
|
}
|
|
- currentPanel = polygonProperty;
|
|
|
|
break;
|
|
break;
|
|
|
|
+
|
|
default:
|
|
default:
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
- SetMeasurePanel(currentPanel);
|
|
|
|
|
|
+
|
|
|
|
+ ClearMeasurePanel();
|
|
}
|
|
}
|
|
|
|
|
|
private void StraightnessProperty_LineMeasureParamChanged(object sender, LineMeasureParam e)
|
|
private void StraightnessProperty_LineMeasureParamChanged(object sender, LineMeasureParam e)
|
|
@@ -120,6 +126,7 @@ namespace ComPDFKit.Controls.Measure
|
|
|
|
|
|
private void SetMeasurePanel(UIElement newChild)
|
|
private void SetMeasurePanel(UIElement newChild)
|
|
{
|
|
{
|
|
|
|
+ currentPanel = newChild;
|
|
MeasurePropertyPanel.Child = newChild;
|
|
MeasurePropertyPanel.Child = newChild;
|
|
}
|
|
}
|
|
|
|
|