Esempio n. 1
0
        private static void WindowPreviewKeyDown(object sender, KeyEventArgs e)
        {
            if (e.Key == Key.F12)
            {
                var window         = (Window)sender;
                var devToolsWindow = default(Window);

                if (s_open.TryGetValue(window, out devToolsWindow))
                {
                    devToolsWindow.Activate();
                }
                else
                {
                    var devTools = new DevTools(window);

                    devToolsWindow = new Window
                    {
                        Width         = 1024,
                        Height        = 512,
                        Content       = devTools,
                        DataTemplates = new DataTemplates
                        {
                            new ViewLocator <ReactiveObject>(),
                        }
                    };

                    devToolsWindow.Closed += devTools.DevToolsClosed;
                    s_open.Add((Window)sender, devToolsWindow);
                    devToolsWindow.Show();
                }
            }
        }
Esempio n. 2
0
        private static void WindowPreviewKeyDown(object sender, KeyEventArgs e)
        {
            if (e.Key == Key.F12)
            {
                var window = (Window)sender;
                var devToolsWindow = default(Window);

                if (s_open.TryGetValue(window, out devToolsWindow))
                {
                    devToolsWindow.Activate();
                }
                else
                {
                    var devTools = new DevTools(window);

                    devToolsWindow = new Window
                    {
                        Width = 1024,
                        Height = 512,
                        Content = devTools,
                        DataTemplates = new DataTemplates
                        {
                            new ViewLocator<ReactiveObject>(),
                        }
                    };

                    devToolsWindow.Closed += devTools.DevToolsClosed;
                    s_open.Add((Window)sender, devToolsWindow);
                    devToolsWindow.Show();
                }
            }
        }