![get mouse coordinates get mouse coordinates](https://i.stack.imgur.com/YMhMk.jpg)
However, in this example, the mouse pointer location is accessed is under the xaml.cs and not inside an actual View-Model. I have already read many of the examples and documentation of Sci-Chart such as: Vertical Slice Tooltips Example. In simple words, every time I press a button, I need the position of the mouse pointer to get captured and used as the location of the new VerticalSliceModifer that I am going to create. To get extended error information, call GetLastError. Return value Type: BOOL Returns nonzero if successful or zero otherwise. In order to do that, I will require having access to the Mouse cursor position of my SciChartSurface to set the X1 property of the VerticalLineAnnotation, that would be used for the VerticalSliceModifiers (to be created). A pointer to a POINT structure that receives the screen coordinates of the cursor. What I am trying to do next, is to add functionality in my application, such that I can add more VerticalSliceModifiers to my ChartModifierGroup when a button is pressed. I just ran into this problem in my Java Robot programming, and the short answer is, to get the current mouse cursor location/position, use the getPointerInfo method of the class, like this: Point p MouseInfo.getPointerInfo(). (probeline) Ĭ(rubberBandXyZoomModifier) Ĭ(zoomPanModifier) Ĭ(yAxisDragModifier) Ĭ(xAxisDragModifier) Ĭ(mouseWheelZoomModifier) Ĭ(zoomExtentsModifier) Ĭ(verticalSliceModifier) Ĭ(cursorModifier) Var verticalSliceModifier = new VerticalSliceModifier RubberBandStrokeDashArray = new DoubleCollection ,
![get mouse coordinates get mouse coordinates](http://files.smashingmagazine.com/wallpapers/june-15/strawberry-fields/cal/june-15-strawberry-fields-cal-1680x1200.jpg)
RubberBandFill = (SolidColorBrush)(new BrushConverter().ConvertFrom("#33FFFFFF")), Var rubberBandXyZoomModifier = new RubberBandXyZoomModifierĮxecuteOn = .MouseLeftButton,
#Get mouse coordinates code
The following code is a method that adds members to that ModiferGroup (called ChartModiferGroup in my View-Model): private void CreateChartModifiers() This following snipped is a copy of my XAML code in which I have all the data bindings set: Īs can be seen from the code above, the ChartModifier property is one of the items that has Data binding to an instance of a ModiferGroup I have created in my View-Model in the background. I have lots of data bindings to my chart properties in my View Model in the background. As the title indicates, I am trying to get mouse cursor position (Coordinates) from a SciChartSurface in MVVM manner.