CompositionTarget.GetCompositorForCurrentThread Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Retrieves the Compositor object for this thread.
public:
static Compositor ^ GetCompositorForCurrentThread();
static Compositor GetCompositorForCurrentThread();
public static Compositor GetCompositorForCurrentThread();
function getCompositorForCurrentThread()
Public Shared Function GetCompositorForCurrentThread () As Compositor
Returns
The Compositor object for this thread.
Remarks
In XAML apps, we recommend that you call ElementCompositionPreview.GetElementVisual(UIElement) to get a Composition Visual, and get the Compositor
from the visual's inherited Compositor property. In cases where you don't have access to a UIElement
(for example, if you create a CompositionBrush in a class library), you can call CompositionTarget.GetCompositorForCurrentThread
to get the Compositor instead.