代码改变世界

Properties Sepcific to RoutedEventArgs

2011-12-29 14:38  一一九九  阅读(292)  评论(0编辑  收藏  举报
  • Source:  the object that raised the event. this is a property you will generally be interested in . it’s useful to note that with routed events this is likely to be different from the sender.
  • OriginalSource: this returns orginal reporting source. that is the object that really raised the event. this property does not change as the event travels along its route.
  • Handled:  A bool that lets you know if the event has already been handled. you should mark this true in your own handlers.
  • RoutedEvent: this identifies the type of event that was raised. Many events have the same signature, and a single handler might be reposonsible for serveral events.

     

      StackPanel does not have its own click event. howerver, we can use an attached event to reference the events raised by its child elements. Attached events work very much like attached properties. They take the form of Type.Eventname, where Type is the name of the class that owns the event.

       DependencyProperty.UnSetValue is a special value used by dependency properties to indicate that the property has not been set. when you work with denpendency properties, use this instead of null.