private void CreateAndShowContent() { Dispatcher = Dispatcher.CurrentDispatcher; VisualTargetPresentationSource source = new VisualTargetPresentationSource(HostVisual); _sync.Set(); source.RootVisual = _createContent(); DesiredSize = source.DesiredSize; _invalidateMeasure(); Dispatcher.Run(); source.Dispose(); }
private void CreateAndShowContent() { if (Dispatcher == null) { Dispatcher = Dispatcher.CurrentDispatcher; } VisualTargetPresentationSource source = new VisualTargetPresentationSource(HostVisual); _sync.Set(); _content = _createContent(); source.RootVisual = _content; _invalidateMeasure(); if (!_usingExternalDispatcher) { Dispatcher.Run(); } source.Dispose(); }