private void ShowOptionsWindow() { if (!_optionsWindow.IsVisible) { // Create the option window object and display it _optionsWindow = new OptionsWindow(_overlay); _optionsWindow.Show(); System.Windows.Threading.Dispatcher.Run(); } }
public MainWindow() { InitializeComponent(); // Create an unused OptionsWindow object to ensure the logic in ShowOptionsWindow() works on the first execution _optionsWindow = new OptionsWindow(_overlay); // Instantiate and display the ping overlay _overlay = new PingOverlay(); _overlay.Run(); }