public void BlockUntilNavigationFinished() { bool done = false; NavigateFinished += (sender, e) => done = true; while (!done) { Application.DoEvents(); Application.RaiseIdle(new EventArgs()); } }