A forum dedicated to WPF version of LightningChart Ultimate.
Moderator: Queue Moderators
-
cchrc
- Posts: 11
- Joined: Mon Oct 19, 2020 10:59 pm
Post
by cchrc » Thu Apr 29, 2021 5:25 pm
Hi,
Under certain circumstances I would like to prevent the position change of markers in the PositionChanged event handler.
So, in the handler i have something like this
Code: Select all
private void Marker_PositionChanged(object sender, PositionChangedSeriesEventMarkerEventArgs e)
{
// ....... //
if (true)
{
e.CancelRendering = true;
return;
}
// ....... //
}
however the CancelRendering do not revert the marker position change.
How can I achieve this?
Thanks.
-
ArctionKestutis
- Posts: 557
- Joined: Mon Mar 14, 2016 9:22 am
Post
by ArctionKestutis » Fri Apr 30, 2021 1:13 pm
It is probably not obvious from the name, but intention of CancelRendering was to prevent extra rendering cycle when updating other chart properties in event handler. We will look at the issue and decide whatever dragging of Marker should also be canceled.
As for now there is no other way to restore previous position, but to copy position from some cached values.
-
cchrc
- Posts: 11
- Joined: Mon Oct 19, 2020 10:59 pm
Post
by cchrc » Sat May 01, 2021 11:20 am
Hi,
yep I read that the CancelRendering prop is not for preventing the marker move, however I gave it a try
I resolved my problem in this way:
Code: Select all
if (true)
{
e.Marker.YValue = pointLineSeries.Points[pointIndex].Y;
}
else
{
pointLineSeries.Points[pointIndex].Y = e.Marker.YValue;
}
Thanks,
C.