title: Can WinUI 3 be used for offscreen rendering of a xaml tree?
body: <p>I would like to use the new WinUI 3 framework to render a 2D xaml tree to a DirectX texture.</p>
  <p>Ideally, I want to be able to supply the WinUI infrastructure with my own DirectX device, context and rendering target and it will render the xaml content onto my rendering target.</p>
  <p>I basically want to embed WinUI 3 into an existing 3D graphics engine.</p>
  <p>From skimming through the documentation, I can see that some form of <a href="https://docs.microsoft.com/en-us/windows/uwp/composition/composition-native-interop" rel="nofollow noreferrer">DirectX interoperability</a> exists via <a href="https://docs.microsoft.com/en-us/windows/winui/api/microsoft.ui.composition.compositiongraphicsdevice?view=winui-3.0" rel="nofollow noreferrer">CompositionGraphicsDevice</a> class. But I haven't been able to understand if this mechanism is intended to be used in order to embed custom D3D content into an existing WinUI-based UI or the other way around.</p>
  <p>So Can this be done? Can WinUI 3 be used for offscreen rendering of a xaml tree <strong>without creating a Window</strong>? Can you outline the steps required to do so?</p>