예제 #1
0
        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));
        }
예제 #2
0
        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));
        }