什么是base.OnManipulationStarted(e)在C#.Net中的OnManipulationStarted(ManipulationStartedEventArgs e)中的用途?

时间:2012-11-03 12:21:02

标签: c# .net visual-studio-2010 c#-4.0

我创建了一个使用

的程序
OnManipulationStarted(ManipulationStartedEventArgs e) 
然后我找到了

base.OnManipulationStarted(e) 

自动插入代码....我已经注释了该行并检查了程序输出没有改变的程序。这个代码在默认方法中存在的原因是什么?

OnManipulationStarted(ManipulationStartedEventArgs e) 

任何帮助请...提前致谢..

2 个答案:

答案 0 :(得分:1)

它调用基类“ overriding 方法的实现。如果要保留OnManipulationStarted的基类行为,则应将该行留在被覆盖的实现中。

答案 1 :(得分:0)

它调用方法的基类实现。

特别是,如果你不打电话,我不希望实际提出ManipulationStartedEvent。我的猜测是你没有看到任何行为上的变化,因为没有人订阅该事件。

除非你故意压制事件(这听起来对我来说是个坏主意),否则你应该保留基本电话。