private void OnUnloaded(object sender, RoutedEventArgs e) { if (_mediaElementThreadInfo != null) { _mediaElementThreadInfo.Dispose(); _mediaElementThreadInfo = null; } }
private void OnLoaded(object sender, RoutedEventArgs e) { if (_mediaElementThreadInfo != null) { return; } _mediaElementThreadInfo = MediaElementThreadFactory.CreateMediaElementsOnWorkerThread(CreateBusyIndicator); Child = _mediaElementThreadInfo.HostVisual; }
private void OnUnloaded(object sender, RoutedEventArgs e) { if (_ignoreUnloadedEventCount > 0) { _ignoreUnloadedEventCount--; return; } if (_mediaElementThreadInfo != null) { _mediaElementThreadInfo.Dispose(); _mediaElementThreadInfo = null; } }