Hello,
I am using the BrushAnnotation and it works fine except that the
mouseover events seems to happen too soon.
I mean that when the mouse is close to the BrushAnnotation, but not on it,
the mouse cursor changed and I can drag the BrushAnnotation.
It happens for all lines but especially for shapes with many segments which
are closed to each other, see attached file ‘MouseOver event too soon (my application).png’.
I saw something similar in your ‘Trade Annotation’ example ,
it happens when I used the Tools=>Pointer, see attached figure ‘MouseOver event too soon (from Scichart example).png’.
Can I changed the distance from which the mouseover event starts?
Best regards,
Eyal
- Eyal Nevo asked 3 years ago
- You must login to post comments
Hi Eyal,
There is a reason why the annotation has a thicker hit-test area, so that it can be easily clicked on. However, if this is too large it can be adjusted by setting a property.
The ControlTemplate for BrushAnnotation looks like this
<ControlTemplate x:Key="BrushAnnotationTemplate" TargetType="{x:Type tradingAnnotations:BrushAnnotation}">
<Grid x:Name="PART_LineAnnotationRoot">
<Polyline
x:Name="PART_GhostPolyLine"
Stroke="Transparent"
StrokeThickness="{x:Static s:ManipulationMargins.AnnotationLineWidth}" />
<Polyline
x:Name="PART_Polyline"
Opacity="{TemplateBinding Opacity}"
Stroke="{TemplateBinding Stroke}"
StrokeThickness="{TemplateBinding StrokeThickness}" />
</Grid>
</ControlTemplate>
You will notice the GhostPolyLine has a StrokeThickness equal to static property ManipulationMargins.AnnotationLineWidth. Setting this property in code will reduce the hit-test size of all annotations, e.g.
ManipulationMargins.AnnotationLineWidth = 3;
Let me know if this helps,
Best regards,
Andrew
- Andrew Burnett-Thompson answered 3 years ago
- You must login to post comments
Please login first to submit.