private void HandleEvent(object sender, RoutedEventArgs e)
 {
     // Try to figure out what element handled the event. Not precise.
     if (this.isEnabled)
     {
         var entry = new EventEntry(sender, e.Handled);
         if (this.currentEvent != null && this.currentEvent.EventArgs == e)
         {
             this.currentEvent.AddEventEntry(entry);
         }
         else
         {
             this.currentEvent = new TrackedEvent(e, entry);
             this.EventHandled(this.currentEvent);
         }
     }
 }
 public TrackedEvent(RoutedEventArgs routedEventArgs, EventEntry originator)
 {
     this.EventArgs = routedEventArgs;
     this.AddEventEntry(originator);
 }