I'm subscribing to an event this way:
s1.MouseUp += (s, e) =>
{
indexOfPointToMove = -1;
s1.LineStyle = LineStyle.Solid;
MyModel.RefreshPlot(false);
e.Handled = true;
};
How could I unsubscribe in different scope? (but in scope of s1
)
I've tried the following:
s1.MouseUp = null;
s1.MouseUp -=(s,e) =>
{
indexOfPointToMove = -1;
s1.LineStyle = LineStyle.Solid;
MyModel.RefreshPlot(false);
e.Handled = true;
};
s1.MouseUp += (s,e) =>
{
//nothing
};
But the event is still firing, how can this be done?