SwapChainBackgroundPanel SwapChainBackgroundPanel SwapChainBackgroundPanel Class

Note

SwapChainBackgroundPanel may be altered or unavailable for releases after Windows 8.1 Instead, use SwapChainPanel.

Implements a XAML layout surface target for Microsoft DirectX interoperation scenarios. This panel has some atypical restrictions on its usage within an app window; see Remarks.

Syntax

Declaration

public class SwapChainBackgroundPanelpublic class SwapChainBackgroundPanelPublic Class SwapChainBackgroundPanel
<SwapChainBackgroundPanel .../>

Inheritance Hierarchy

Inherited Members

Inherited properties

, , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
Tag
Tag
Tag
, , , , , , , , , , , , , , , , , , , , , , , , ,

Inherited events

, , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,

Inherited methods

, , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,

Remarks

Important

SwapChainBackgroundPanel is deprecated and may not be supported in future releases. Change any existing code that used SwapChainBackgroundPanel to use SwapChainPanel instead. There's no downside to using SwapChainPanel, the API is new because it relies upon an upgrade in the internal rendering and composition systems that were introduced starting with Windows 8.1.

For most scenarios a SwapChainPanel will provide a more versatile Microsoft DirectX interop render surface than a SwapChainBackgroundPanel does. That's because a SwapChainPanel doesn't have many of the XAML-side composition limitations that are listed in the "Composition limitations" section below. For example you can apply a RenderTransform to a SwapChainPanel. For more info, see DirectX and XAML interop and SwapChainPanel.

A SwapChainBackgroundPanel is a Grid subclass, so you can use ColumnDefinitions and RowDefinitions properties to declare the panel's characteristics, and the attached properties of Grid such as RowDefinitions and ColumnDefinitions on child elements to position those child elements in the layout.

For more info on how to use SwapChainBackgroundPanel, including sample code, see DirectX and XAML interop.

The SwapChainBackgroundPanel class does not inherit from the Control class, and you cannot force focus to this element. Events that rely on having focus, such as KeyUp and KeyDown, may have no effect.

Initializing a SwapChainPanel element

Before a SwapChainPanel can render content, you must initialize it from the Microsoft DirectX side.

Cast the SwapChainBackgroundPanel instance to IInspectable or IUnknown, then call QueryInterface to obtain a reference to the ISwapChainBackgroundPanelNative interface (this is the native interface implementation that is the complement to the SwapChainBackgroundPanel and enables the interop bridge). Then, call ISwapChainBackgroundPanelNative::SetSwapChain on that reference to associate your implemented swap chain with the SwapChainBackgroundPanel instance.

It's common to put the code that queries the interface and sets the swap chain as part of a Create*Resources method. The Create*Resources methods are an implementation pattern that's seen in the Microsoft DirectX Renderer class templates/examples.

The API that enables you to add a SwapChain to an existing SwapChainPanel is not a runtime class API, it is a Microsoft DirectX API. You implement the swap chain input as a Microsoft DirectX interface (IDXGISwapChain).

Composition limitations

  • A SwapChainBackgroundPanel element can only appear as the root element of a XAML element tree, or cannot have a parent element if the object tree is established through code.
  • The SwapChainBackgroundPanel exists as a discrete layout element mainly so that you can satisfy some of the existing restrictions on Microsoft DirectX SwapChain integration within a Windows UI. In particular, there can only be one SwapChain per window, and the visuals in that overlay appear last in any possible z-order displayed in the window.
  • Although SwapChainBackgroundPanel is a UIElement derived class, projection and transformation API have no effect upon its rendering presentation.
  • Some of the non-layout properties that are inherited from Grid or from base classes such as FrameworkElement have no effect when set on a SwapChainBackgroundPanel. This is because it is the Microsoft DirectX SwapChain that should have the greater influence over what appears within the panel.

Constructors summary

Note

SwapChainBackgroundPanel may be altered or unavailable for releases after Windows 8.1 Instead, use SwapChainPanel.

Initializes a new instance of the SwapChainBackgroundPanel class.

Methods summary

Note

SwapChainBackgroundPanel may be altered or unavailable for releases after Windows 8.1 Instead, use SwapChainPanel.

Creates a core input object that handles the input types as specified by the deviceTypes parameter.

Constructors

  • SwapChainBackgroundPanel()
    SwapChainBackgroundPanel()
    SwapChainBackgroundPanel()
    SwapChainBackgroundPanel()
    Note

    SwapChainBackgroundPanel may be altered or unavailable for releases after Windows 8.1 Instead, use SwapChainPanel.

    Initializes a new instance of the SwapChainBackgroundPanel class.

    public SwapChainBackgroundPanel()public New()Public Sub New()public SwapChainBackgroundPanel()

Methods

  • CreateCoreIndependentInputSource(CoreInputDeviceTypes)
    CreateCoreIndependentInputSource(CoreInputDeviceTypes)
    CreateCoreIndependentInputSource(CoreInputDeviceTypes)
    CreateCoreIndependentInputSource(CoreInputDeviceTypes)
    Note

    SwapChainBackgroundPanel may be altered or unavailable for releases after Windows 8.1 Instead, use SwapChainPanel.

    Creates a core input object that handles the input types as specified by the deviceTypes parameter.

    public CoreIndependentInputSource CreateCoreIndependentInputSource(CoreInputDeviceTypes deviceTypes)public CoreIndependentInputSource CreateCoreIndependentInputSource(CoreInputDeviceTypes deviceTypes)Public Function CreateCoreIndependentInputSource(deviceTypes As CoreInputDeviceTypes) As CoreIndependentInputSourcepublic CoreIndependentInputSource CreateCoreIndependentInputSource(CoreInputDeviceTypes deviceTypes)

    Parameters

    Returns

    Remarks

    Important

    You must call CreateCoreIndependentInputSource(CoreInputDeviceTypes) from a non-UI thread, otherwise this method will fail.

Device family

Windows 10 (introduced v10.0.10240.0)

API contract

Windows.Foundation.UniversalApiContract (introduced v1)

Attributes

Windows.Foundation.Metadata.ComposableAttribute
Windows.Foundation.Metadata.ContractVersionAttribute
Windows.Foundation.Metadata.MarshalingBehaviorAttribute
Windows.Foundation.Metadata.ThreadingAttribute
Windows.Foundation.Metadata.WebHostHiddenAttribute

Details

Assembly

Windows.UI.Xaml.Controls.dll