Pre loader

Tag: MouseDoubleClick

Welcome to the SciChart Forums!

  • Please read our Question Asking Guidelines for how to format a good question
  • Some reputation is required to post answers. Get up-voted to avoid the spam filter!
  • We welcome community answers and upvotes. Every Q&A improves SciChart for everyone

WPF Forums | JavaScript Forums | Android Forums | iOS Forums

0 votes
0 answers
12k views

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 active 9 years ago
0 votes
22k views

I want to implement a PopUpWindowAction and InteractionRequestTrigger via the Micrsoft PRISM Libray:
But it starts with basic problems:
I’m not able to create a correct invokeCommandAction, the RaisItemSelection method gets never executed?

Xaml:

<s:SciChartSurface>
  <i:Interaction.Triggers>
                <i:EventTrigger EventName="MouseDoubleClick">
                    <i:InvokeCommandAction Command="{Binding MouseDoubleClickCommand}" CommandParameter="{}" />
                </i:EventTrigger>
    </i:Interaction.Triggers>
</<s:SciChartSurface>

xaml.cs:

MouseDoubleClickCommand = new DelegateCommand<object>(RaiseItemSelection);
 private void RaiseItemSelection(object obj)
        {
        }
Showing 2 results

Try SciChart Today

Start a trial and discover why we are the choice
of demanding developers worldwide

Start TrialCase Studies