public static IDisposable Attach(TopLevel root, DevToolsOptions options) { void PreviewKeyDown(object sender, KeyEventArgs e) { if (options.Gesture.Matches(e)) { Open(root, options); } } return(root.AddDisposableHandler( InputElement.KeyDownEvent, PreviewKeyDown, RoutingStrategies.Tunnel)); }
public static IDisposable Attach(TopLevel root, DevToolsOptions options) { if (s_attachedToApplication == true) { throw new ArgumentException("DevTools already attached to application", nameof(root)); } void PreviewKeyDown(object?sender, KeyEventArgs e) { if (options.Gesture.Matches(e)) { Open(root, options); } } return(root.AddDisposableHandler( InputElement.KeyDownEvent, PreviewKeyDown, RoutingStrategies.Tunnel)); }