0

I am a bit new to wpf programming and have been from web programming. while read and article about routed event
Routed Event overview - Josh Smith

So Do I need to handle all events necessarily In wpf do I need to put e.handled at end of each routed event.

Do help me to get in the right direction with concepts about routed events

Thanks in anticipation.

Hardik
  • 1,716
  • 6
  • 27
  • 41

1 Answers1

0

It's up to you where you want to stop the event. but in the general case the event will route from source to top parent and from top parent to source.

To understand the Routed Events let’s have a practical example. It’s like a bus running on the route and you are the owner of this bus. This bus has a duty. You run this bus from point A to Point B. obtusely you would be running this bus on the both side of the route. So from Point A to Point B and from Point B to Point A. where your point A is the original source of the handler where you have executed the event (bubbling Strategy). and the point B is the Top Parent source (in Bubbling strategy) case. And in the other case you run the bus from Point B to point A. where you Point B is the Root object of you control or window and the Point A becomes the actual unit on which the event is triggered. one day you feel that you can't handle to drive the bus all day from Source Point A to Point B or from Point B to Point A. So you just stopped your Bus at curtain point.

JSJ
  • 5,653
  • 3
  • 25
  • 32
  • Right, Its upto requirement. But what should be the best practice ? I mean it we dont handle each event, does it cost performance decrease ? – Hardik Jun 25 '13 at 06:56
  • its simple. make your own route. handle when you want. untill leave it as it is. – JSJ Jun 25 '13 at 08:35