Ejemplo n.º 1
0
        private void CreateAndShowContent()
        {
            Dispatcher = Dispatcher.CurrentDispatcher;
            VisualTargetPresentationSource source =
                new VisualTargetPresentationSource(_hostVisual);
            _sync.Set();
            source.RootVisual = _createContent();
            DesiredSize = source.DesiredSize;
            _invalidateMeasure();

            Dispatcher.Run();
            source.Dispose();
        }
Ejemplo n.º 2
0
        private void MediaWorkerThread(object arg)
        {
            HostVisual hostVisual = (HostVisual)arg;
            var visualTargetPS = new VisualTargetPresentationSource(hostVisual);

            _threadReadyEvent.Set();
            // Create a MediaElement and use it as the root visual for the
            // VisualTarget.
            visualTargetPS.RootVisual = CreateUIElement();

            // Run a dispatcher for this worker thread.  This is the central
            // processing loop for WPF.
            System.Windows.Threading.Dispatcher.Run();

        }