// If this element is currently listening to synchronized input, add a pre-opportunity handler to keep track of event routed through this element. internal void AddSynchronizedInputPreOpportunityHandler(EventRoute route, RoutedEventArgs args) { if (InputManager.IsSynchronizedInput) { if (SynchronizedInputHelper.IsListening(this, args)) { RoutedEventHandler eventHandler = new RoutedEventHandler(this.SynchronizedInputPreOpportunityHandler); SynchronizedInputHelper.AddHandlerToRoute(this, route, eventHandler, false); } } }
// If this element is currently listening to synchronized input, add a handler to post process the synchronized input otherwise // add a synchronized input pre-opportunity handler from parent if parent is listening. internal void AddSynchronizedInputPostOpportunityHandler(EventRoute route, RoutedEventArgs args) { if (InputManager.IsSynchronizedInput) { if (SynchronizedInputHelper.IsListening(this, args)) { RoutedEventHandler eventHandler = new RoutedEventHandler(this.SynchronizedInputPostOpportunityHandler); SynchronizedInputHelper.AddHandlerToRoute(this, route, eventHandler, true); } else { // Add a preview handler from the parent. SynchronizedInputHelper.AddParentPreOpportunityHandler(this, route, args); } } }