I am reading the "value under the cursor" for the contents of the chart. I am currently achieving this using ReactiveExtensions and subscribing to the GetMouseMove event in my Grid chart background:
private void SetupMouseover( Grid plotArea)
{
var mouseMove = from mo in plotArea.GetMouseMove()
select new
{
CurrentPos = mo.EventArgs.GetPosition( plotArea )
};
mouseMove.Subscribe(
item =>
{
readoutTextBlock.Text = PositionToReadoutValue(item.CurrentPos);
}
);
}
And it works great. I can move the mouse and I am updating my text block.
The problem is that the contents of the chart are dynamically updated (move around the screen). If I left the mouse cursor still above the point, the content below it will change, but (obviously) the reading will not be updated.
I tried to manually start moving the mouse, setting the cursor position on myself whenever the data in the model was updated:
private void MoveCursor()
{
System.Windows.Forms.Cursor.Position = new System.Drawing.Point(System.Windows.Forms.Cursor.Position.X,
System.Windows.Forms.Cursor.Position.Y);
}
. (X-1, Y-1) DID , ( X + 1, Y + 1), mousemove .
readoutTextBlock , Mouse.GetPosition(m_PlotArea), ( ), m_PlotArea.
?