private void OnButtonUp(object sender, ButtonEventArgs e) { // Show a modeless dialog window SecondWindow wnd = new SecondWindow(); wnd.Visibility = Visibility.Visible; // Right after showing the window execution immediatelly continues here }