private static void PrepareContentPresenterForCompositor(ContentPresenter presenter, bool applyBitmapCache = true) { if (presenter != null) { if (applyBitmapCache) { presenter.CacheMode = BitmapCacheMode; } presenter.IsHitTestVisible = false; } }