private void CreateAndShowContent() { Dispatcher = Dispatcher.CurrentDispatcher; VisualTargetPresentationSource source = new VisualTargetPresentationSource(_hostVisual); _resetEvent.Set(); source.RootVisual = _createContent(); DesiredSize = source.DesiredSize; _invalidateMeasure(); Dispatcher.Run(); source.Dispose(); }