Exemplo n.º 1
0
        private void PostInitializeWindow()
        {
            Activate();
            Focus();

            // Set the name of the inspected app to the title
            var    process     = Process.GetCurrentProcess();
            string processName = process.MainWindowTitle ?? process.ProcessName;

            Title += " -  " + processName;

            try
            {
                var interopHelper = new WindowInteropHelper(this);
                _handle = interopHelper.Handle;
                NativeMethods.SetForegroundWindow(_handle);
            }
            catch (Exception)
            {
            }

            if (_viewModel.ShowUsageHint)
            {
                var usageHintWindow = new UsageHintWindow();
                usageHintWindow.Owner = this;
                usageHintWindow.ShowDialog();
            }

            // Initialize this service
            ServiceLocator.Resolve <MouseElementService>();
        }
        private void PostInitializeWindow()
        {
            Activate();
            Focus();

            // Set the name of the inspected app to the title
            var process = Process.GetCurrentProcess();
            string processName = process.MainWindowTitle ?? process.ProcessName;
            Title += " -  " + processName;

            try
            {
                var interopHelper = new WindowInteropHelper(this);
                _handle = interopHelper.Handle;
                NativeMethods.SetForegroundWindow(_handle);
            }
            catch (Exception)
            {
            }

            if( _viewModel.ShowUsageHint)
            {
                var usageHintWindow = new UsageHintWindow();
                usageHintWindow.Owner = this;
                usageHintWindow.ShowDialog();
            }

            // Initialize this service
            ServiceLocator.Resolve<MouseElementService>();
        }