Good day!
I have a problem with annotations. When I add them by double clicking on surface with this snippet of code:
private TextPointAnnotation LoadTextPointAnnotation(double x1, double y1)
{
var textPoint = new TextPointAnnotation
{
X1 = x1,
Y1 = y1,
ElementX2 = -10,
ElementY2 = -5,
ElementFontSize = 9,
AnnotationName = "TXTAnnot" + _annotaionCount,
ElementFontColor = Colors.Yellow,
ElementWidth = 50,
ElementHeight = 20,
BorderBrush = new SolidColorBrush(Colors.Red),
Background = new SolidColorBrush(Color.FromArgb(78, 255, 0, 0)),
YAxisId = TextOfYAxis,
IsHidden = !_isTextPointAnnotationsVisible,
IsEditable = true,
AnnotationCanvas = AnnotationCanvas.AboveChart,
CanEditText = false
};
textPoint.ElementText = String.Format("{0}", textPoint.AnnotationName);
textPoint.ContextMenu = BuildMenu(textPoint);
textPoint.MouseMove += AnnotationMove;
textPoint.MouseRightButtonDown += OnRightMouseAnnotationDown;
textPoint.PreviewMouseLeftButtonDown += textPoint_PreviewMouseLeftButtonDown;
textPoint.PreviewMouseMove += textPoint_PreviewMouseMove;
AnnotationCollection.Add(textPoint);
return textPoint;
}
They are visible for mouse actions (for example, mouse move, mouse down and etc.)(Image 1)
But when I add them programmaticaly, for example in Loaded method- LoadTextPointAnnotation(100,200), they are not visible for mouse actions, that I’ve already mentioned above(Image 2).
What is the reason of strange behaviour?
Thanks in advance.
- Egor asked 9 years ago
- last edited 9 years ago
- You must login to post comments
Please login first to submit.