private void Dispose(bool disposing) { if (Dispatcher == null) { throw new ObjectDisposedException("UIThreadPoolThread"); } Dispatcher dispatcher = Dispatcher; Dispatcher = null; UIThreadPool.DecrementThread(dispatcher); }
public UIThreadPoolRoot() { // The UIThreadPoolRoot instance itself is owned by the calling // thread, which is typically the UI thread. It uses a HostVisual // as its only child to host the results of inflating the template // on a thread pool thread. HostVisual child = new HostVisual(); Child = child; _threadPoolThread = UIThreadPool.AcquireThread(); _threadPoolThread.Dispatcher.Invoke((Action) delegate { _root = new VisualTargetPresentationSource(child); _root.SizeChanged += VisualTargetSizeChanged; }); }
internal UIThreadPoolThread(Dispatcher dispatcher) { UIThreadPool.IncrementThread(dispatcher); Dispatcher = dispatcher; }