Your SlideShare is downloading. ×
Routed events in silverlight
Upcoming SlideShare
Loading in...5

Thanks for flagging this SlideShare!

Oops! An error has occurred.

Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Routed events in silverlight


Published on

Published in: Technology

  • Be the first to comment

  • Be the first to like this

No Downloads
Total Views
On Slideshare
From Embeds
Number of Embeds
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

No notes for slide


  • 1. Routed Events
    Senior Software Engineer
    United Health Group
  • 2. Mahender Sarangam
    Having 5 years of experience on .NET Technologies. Working as a Senior Software Engineer in United Health Group (UHG India Information Service Ltd.). Worked with Big Firms like Deloitte Consulting & Wipro Technology.
    Got Technical Acquaintance on Technologies like C#, ASP.NET,AJAX, LINQ, Silverlight, WPF,WCF ,SQL Server, Team Foundation Server(TFS) and SharePoint Technology.
    MCTS Certified in Web Technologies.
    Blog :
  • 3. What are Routed Events?
    Events in Silverlight are used much like events in any other .NET technology.
    In Silverlight, there are two general event cases: input events and non-input events
    For example, event routing allows a click that begins in a shape to rise up to that shape’s container and then to the containing page before it’s handled by your code.
    There are three types of RoutedEvents - direct, tunneling, and bubbling
  • 4. Direct - This type of routed events can be handled only by the controls that had raised them. They are very similar to the events we are familiar with from WinForms and ASP.NET. Tunneling - By this type of events, first the handlers of the root element of the visual tree are invoked and then the event travels through the child elements till it reaches the one that originally has raised it. Bubbling - This type of events is first handled by their source and then the event handlers of the parent elements are invoked till the event reaches the root element of the visual tree.
  • 5. The main difference between routed events and standard CLR events, to the handler of the event, is that the event sender isn’t necessarily the original source of the event.
    In order to get the original source of the event, you need to check the OriginalSource property of the RoutedEventArgs supplied to the handler.
  • 6. Disadvantages in Routed in SL
    There are some differences between the routed events in Silverlight and WPF. Here are the most important of them:
    You cannot create custom RoutedEvents in Silverlight. In WPF to create a custom event of this type we use EventManager, but in Silverlight it's not available.
    The only type of routed events in Silverlight is the bubbling event. Such events for example are the MouseLeftButtonDown and the MouseLeftButtonUp.
    The control specific events don't bubble - for example the Click event of the Button control.
  • 7. Thank you