我正在以这种方式订阅一个活动:
s1.MouseUp += (s, e) =>
{
indexOfPointToMove = -1;
s1.LineStyle = LineStyle.Solid;
MyModel.RefreshPlot(false);
e.Handled = true;
};
我怎样才能在不同的范围内取消订阅?(但在范围内s1
)
我尝试了以下方法:
s1.MouseUp = null;
s1.MouseUp -=(s,e) =>
{
indexOfPointToMove = -1;
s1.LineStyle = LineStyle.Solid;
MyModel.RefreshPlot(false);
e.Handled = true;
};
s1.MouseUp += (s,e) =>
{
//nothing
};
但是事件仍在触发,这怎么办?