SwapChainPanel SwapChainPanel SwapChainPanel SwapChainPanel Class

Definition

Provides a hosting surface, where Microsoft DirectX swap chains provide content that can be rendered into a XAML UI. A SwapChainPanel element is a key component for an app that renders Microsoft DirectX graphics and then presents those visuals within a XAML page.

public : class SwapChainPanel : Grid, ISwapChainPanel
public class SwapChainPanel : Grid, ISwapChainPanel
Public Class SwapChainPanel Inherits Grid Implements ISwapChainPanel
var swapChainPanel = new swapChainPanel();
<SwapChainPanel .../>
Inheritance
Attributes
Windows 10 requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Remarks

A SwapChainPanel 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 Grid.Row and Grid.Column on child elements to position those child elements in the layout.

For code examples that use SwapChainPanel, see XAML SwapChainPanel DirectX interop sample.

The SwapChainPanel class does not inherit from the Control class, so you can't programmatically focus it directly for purposes of capturing key events. Consider setting the focus to a focusable element inside the panel and letting the key event bubble.

In order to maintain crisp vector rendering, you should listen for the CompositionScaleChanged event and query the CompositionScaleX and CompositionScaleY property values to account for the current UI scale, and potentially render again from DirectX. Otherwise XAML layout might do the scaling and your visuals might be degraded.

Initializing a SwapChainPanel element

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

Cast the SwapChainPanel instance to IInspectable or IUnknown, then call QueryInterface to obtain a reference to the ISwapChainPanelNative interface (this is the native interface implementation that is the complement to the SwapChainPanel and enables the interop bridge). Then, call ISwapChainPanelNative::SetSwapChain on that reference to associate your implemented swap chain with the SwapChainPanel 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, and you'll also see this implementation pattern in the SDK samples, and in the code you get from the DirectX (XAML) project template in Microsoft Visual Studio. Specifically, in the DirectX (XAML) project template, you'll see the **QueryInterface ** call and the call to ISwapChainPanelNative::SetSwapChain in the DeviceResources::CreateWindowSizeDependentResources method implementation in DeviceResources.cpp.

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).

SwapChainPanel and SwapChainBackgroundPanel

SwapChainPanel has less restrictions on its interactions and placement in UI than does SwapChainBackgroundPanel.

Swap chains

  • Swap chains must run on the main UI thread. This is usually accomplished by calling SetSwapChain on a reference that was initialized as a XAML object element.
  • A single swap chain can be associated with multiple SwapChainPanel elements. Or, your app can have multiple swap chains, with each providing the presentation for a separate SwapChainPanel.
  • However, performance can decline if many swap chains are updated simultaneously. We recommend that your app use no more than four swap chains.
  • Content that's rendered via the swap chain is not stretched when it's resized by the user; instead, the resizing behavior is similar to setting Stretch="None" on an Image element.
  • There are other techniques for rendering swap chain content that goes directly to the app's core window rather than a XAML-composed element. See CreateSwapChainForCoreWindow.

Processing input on background threads

Using the CreateCoreIndependentInputSource method, apps can process input and render to a SwapChainPanel entirely on one or more background threads. This enables high performance input and rendering independent of the XAML UI thread.

Constructors

SwapChainPanel() SwapChainPanel() SwapChainPanel() SwapChainPanel()

Initializes a new instance of the SwapChainPanel class.

public : SwapChainPanel()
public SwapChainPanel()
Public Sub New()
var swapChainPanel = new swapChainPanel();

Remarks

Important

Initialization through the constructor is not enough to enable the SwapChainPanel element to render the swap chain. You must use a native interface and Microsoft DirectX code. For more info see the "Initializing a SwapChainPanel element" section in the SwapChainPanel class topic.

Properties

CompositionScaleX CompositionScaleX CompositionScaleX CompositionScaleX

Gets the x-axis scale factor of the SwapChainPanel.

public : float CompositionScaleX { get; }
public float CompositionScaleX { get; }
Public ReadOnly Property CompositionScaleX As float
var float = swapChainPanel.compositionScaleX;
Value
float float float float

The x-axis scale factor of the SwapChainPanel. A value of 1.0 means no scaling is applied.

Remarks

The CompositionScaleX scale factor is applied to the swap chain content when it's rendered to the screen and composited into the XAML content. The scale factor is derived from calculating the render transformations (implicit or explicit) applied to the SwapChainPanel and its ancestors.

The scale factor will be an estimate if a Projection property value is present on the SwapChainPanel or one of its ancestors.

Check this property any time you are handling CompositionScaleChanged (CompositionScaleChanged doesn't have event data, but if it fires it means that CompositionScaleX, CompositionScaleY, or both have changed values on this SwapChainPanel ).

See Also

CompositionScaleXProperty CompositionScaleXProperty CompositionScaleXProperty CompositionScaleXProperty

Identifies the CompositionScaleX dependency property.

public : static DependencyProperty CompositionScaleXProperty { get; }
public static DependencyProperty CompositionScaleXProperty { get; }
Public Static ReadOnly Property CompositionScaleXProperty As DependencyProperty
var dependencyProperty = Windows.UI.Xaml.Controls.SwapChainPanel.compositionScaleXProperty;

CompositionScaleY CompositionScaleY CompositionScaleY CompositionScaleY

Gets the y-axis scale factor of the SwapChainPanel.

public : float CompositionScaleY { get; }
public float CompositionScaleY { get; }
Public ReadOnly Property CompositionScaleY As float
var float = swapChainPanel.compositionScaleY;
Value
float float float float

The y-axis scale factor of the SwapChainPanel. A value of 1.0 means no scaling is applied.

Remarks

The CompositionScaleY scale factor is applied to the swap chain content when it's rendered to the screen and composited into the XAML content. The scale factor is derived from calculating the render transformations (implicit or explicit) applied to the SwapChainPanel and its ancestors.

The scale factor will be an estimate if a Projection property value is present on the SwapChainPanel or one of its ancestors.

Check this property any time you are handling CompositionScaleChanged (CompositionScaleChanged doesn't have event data, but if it fires it means that CompositionScaleX, CompositionScaleY, or both have changed values on this SwapChainPanel ).

See Also

CompositionScaleYProperty CompositionScaleYProperty CompositionScaleYProperty CompositionScaleYProperty

Identifies the CompositionScaleY dependency property.

public : static DependencyProperty CompositionScaleYProperty { get; }
public static DependencyProperty CompositionScaleYProperty { get; }
Public Static ReadOnly Property CompositionScaleYProperty As DependencyProperty
var dependencyProperty = Windows.UI.Xaml.Controls.SwapChainPanel.compositionScaleYProperty;

AccessKey AccessKey AccessKey AccessKey

Inherited from UIElement

AccessKeyProperty AccessKeyProperty AccessKeyProperty AccessKeyProperty

Inherited from UIElement

AccessKeyScopeOwner AccessKeyScopeOwner AccessKeyScopeOwner AccessKeyScopeOwner

Inherited from UIElement

AccessKeyScopeOwnerProperty AccessKeyScopeOwnerProperty AccessKeyScopeOwnerProperty AccessKeyScopeOwnerProperty

Inherited from UIElement

ActualHeight ActualHeight ActualHeight ActualHeight

Inherited from FrameworkElement

ActualHeightProperty ActualHeightProperty ActualHeightProperty ActualHeightProperty

Inherited from FrameworkElement

ActualTheme ActualTheme ActualTheme ActualTheme

Inherited from FrameworkElement

ActualThemeProperty ActualThemeProperty ActualThemeProperty ActualThemeProperty

Inherited from FrameworkElement

ActualWidth ActualWidth ActualWidth ActualWidth

Inherited from FrameworkElement

ActualWidthProperty ActualWidthProperty ActualWidthProperty ActualWidthProperty

Inherited from FrameworkElement

AllowDrop AllowDrop AllowDrop AllowDrop

Inherited from UIElement

AllowDropProperty AllowDropProperty AllowDropProperty AllowDropProperty

Inherited from UIElement

AllowFocusOnInteraction AllowFocusOnInteraction AllowFocusOnInteraction AllowFocusOnInteraction

Inherited from FrameworkElement

AllowFocusOnInteractionProperty AllowFocusOnInteractionProperty AllowFocusOnInteractionProperty AllowFocusOnInteractionProperty

Inherited from FrameworkElement

AllowFocusWhenDisabled AllowFocusWhenDisabled AllowFocusWhenDisabled AllowFocusWhenDisabled

Inherited from FrameworkElement

AllowFocusWhenDisabledProperty AllowFocusWhenDisabledProperty AllowFocusWhenDisabledProperty AllowFocusWhenDisabledProperty

Inherited from FrameworkElement

Background Background Background Background

Inherited from Panel

BackgroundProperty BackgroundProperty BackgroundProperty BackgroundProperty

Inherited from Panel

BaseUri BaseUri BaseUri BaseUri

Inherited from FrameworkElement

BorderBrush BorderBrush BorderBrush BorderBrush

Inherited from Grid

BorderBrushProperty BorderBrushProperty BorderBrushProperty BorderBrushProperty

Inherited from Grid

BorderThickness BorderThickness BorderThickness BorderThickness

Inherited from Grid

BorderThicknessProperty BorderThicknessProperty BorderThicknessProperty BorderThicknessProperty

Inherited from Grid

CacheMode CacheMode CacheMode CacheMode

Inherited from UIElement

CacheModeProperty CacheModeProperty CacheModeProperty CacheModeProperty

Inherited from UIElement

CanDrag CanDrag CanDrag CanDrag

Inherited from UIElement

CanDragProperty CanDragProperty CanDragProperty CanDragProperty

Inherited from UIElement

CharacterReceivedEvent CharacterReceivedEvent CharacterReceivedEvent CharacterReceivedEvent

Inherited from UIElement

Children Children Children Children

Inherited from Panel

ChildrenTransitions ChildrenTransitions ChildrenTransitions ChildrenTransitions

Inherited from Panel

ChildrenTransitionsProperty ChildrenTransitionsProperty ChildrenTransitionsProperty ChildrenTransitionsProperty

Inherited from Panel

Clip Clip Clip Clip

Inherited from UIElement

ClipProperty ClipProperty ClipProperty ClipProperty

Inherited from UIElement

ColumnDefinitions ColumnDefinitions ColumnDefinitions ColumnDefinitions

Inherited from Grid

ColumnProperty ColumnProperty ColumnProperty ColumnProperty

Inherited from Grid

ColumnSpacing ColumnSpacing ColumnSpacing ColumnSpacing

Inherited from Grid

ColumnSpacingProperty ColumnSpacingProperty ColumnSpacingProperty ColumnSpacingProperty

Inherited from Grid

ColumnSpanProperty ColumnSpanProperty ColumnSpanProperty ColumnSpanProperty

Inherited from Grid

CompositeMode CompositeMode CompositeMode CompositeMode

Inherited from UIElement

CompositeModeProperty CompositeModeProperty CompositeModeProperty CompositeModeProperty

Inherited from UIElement

ContextFlyout ContextFlyout ContextFlyout ContextFlyout

Inherited from UIElement

ContextFlyoutProperty ContextFlyoutProperty ContextFlyoutProperty ContextFlyoutProperty

Inherited from UIElement

CornerRadius CornerRadius CornerRadius CornerRadius

Inherited from Grid

CornerRadiusProperty CornerRadiusProperty CornerRadiusProperty CornerRadiusProperty

Inherited from Grid

DataContext DataContext DataContext DataContext

Inherited from FrameworkElement

DataContextProperty DataContextProperty DataContextProperty DataContextProperty

Inherited from FrameworkElement

DesiredSize DesiredSize DesiredSize DesiredSize

Inherited from UIElement

Dispatcher Dispatcher Dispatcher Dispatcher

Inherited from DependencyObject

DoubleTappedEvent DoubleTappedEvent DoubleTappedEvent DoubleTappedEvent

Inherited from UIElement

DragEnterEvent DragEnterEvent DragEnterEvent DragEnterEvent

Inherited from UIElement

DragLeaveEvent DragLeaveEvent DragLeaveEvent DragLeaveEvent

Inherited from UIElement

DragOverEvent DragOverEvent DragOverEvent DragOverEvent

Inherited from UIElement

DropEvent DropEvent DropEvent DropEvent

Inherited from UIElement

ExitDisplayModeOnAccessKeyInvoked ExitDisplayModeOnAccessKeyInvoked ExitDisplayModeOnAccessKeyInvoked ExitDisplayModeOnAccessKeyInvoked

Inherited from UIElement

ExitDisplayModeOnAccessKeyInvokedProperty ExitDisplayModeOnAccessKeyInvokedProperty ExitDisplayModeOnAccessKeyInvokedProperty ExitDisplayModeOnAccessKeyInvokedProperty

Inherited from UIElement

FlowDirection FlowDirection FlowDirection FlowDirection

Inherited from FrameworkElement

FlowDirectionProperty FlowDirectionProperty FlowDirectionProperty FlowDirectionProperty

Inherited from FrameworkElement

FocusVisualMargin FocusVisualMargin FocusVisualMargin FocusVisualMargin

Inherited from FrameworkElement

FocusVisualMarginProperty FocusVisualMarginProperty FocusVisualMarginProperty FocusVisualMarginProperty

Inherited from FrameworkElement

FocusVisualPrimaryBrush FocusVisualPrimaryBrush FocusVisualPrimaryBrush FocusVisualPrimaryBrush

Inherited from FrameworkElement

FocusVisualPrimaryBrushProperty FocusVisualPrimaryBrushProperty FocusVisualPrimaryBrushProperty FocusVisualPrimaryBrushProperty

Inherited from FrameworkElement

FocusVisualPrimaryThickness FocusVisualPrimaryThickness FocusVisualPrimaryThickness FocusVisualPrimaryThickness

Inherited from FrameworkElement

FocusVisualPrimaryThicknessProperty FocusVisualPrimaryThicknessProperty FocusVisualPrimaryThicknessProperty FocusVisualPrimaryThicknessProperty

Inherited from FrameworkElement

FocusVisualSecondaryBrush FocusVisualSecondaryBrush FocusVisualSecondaryBrush FocusVisualSecondaryBrush

Inherited from FrameworkElement

FocusVisualSecondaryBrushProperty FocusVisualSecondaryBrushProperty FocusVisualSecondaryBrushProperty FocusVisualSecondaryBrushProperty

Inherited from FrameworkElement

FocusVisualSecondaryThickness FocusVisualSecondaryThickness FocusVisualSecondaryThickness FocusVisualSecondaryThickness

Inherited from FrameworkElement

FocusVisualSecondaryThicknessProperty FocusVisualSecondaryThicknessProperty FocusVisualSecondaryThicknessProperty FocusVisualSecondaryThicknessProperty

Inherited from FrameworkElement

GettingFocusEvent GettingFocusEvent GettingFocusEvent GettingFocusEvent

Inherited from UIElement

Height Height Height Height

Inherited from FrameworkElement

HeightProperty HeightProperty HeightProperty HeightProperty

Inherited from FrameworkElement

HighContrastAdjustment HighContrastAdjustment HighContrastAdjustment HighContrastAdjustment

Inherited from UIElement

HighContrastAdjustmentProperty HighContrastAdjustmentProperty HighContrastAdjustmentProperty HighContrastAdjustmentProperty

Inherited from UIElement

HoldingEvent HoldingEvent HoldingEvent HoldingEvent

Inherited from UIElement

HorizontalAlignment HorizontalAlignment HorizontalAlignment HorizontalAlignment

Inherited from FrameworkElement

HorizontalAlignmentProperty HorizontalAlignmentProperty HorizontalAlignmentProperty HorizontalAlignmentProperty

Inherited from FrameworkElement

IsAccessKeyScope IsAccessKeyScope IsAccessKeyScope IsAccessKeyScope

Inherited from UIElement

IsAccessKeyScopeProperty IsAccessKeyScopeProperty IsAccessKeyScopeProperty IsAccessKeyScopeProperty

Inherited from UIElement

IsDoubleTapEnabled IsDoubleTapEnabled IsDoubleTapEnabled IsDoubleTapEnabled

Inherited from UIElement

IsDoubleTapEnabledProperty IsDoubleTapEnabledProperty IsDoubleTapEnabledProperty IsDoubleTapEnabledProperty

Inherited from UIElement

IsHitTestVisible IsHitTestVisible IsHitTestVisible IsHitTestVisible

Inherited from UIElement

IsHitTestVisibleProperty IsHitTestVisibleProperty IsHitTestVisibleProperty IsHitTestVisibleProperty

Inherited from UIElement

IsHoldingEnabled IsHoldingEnabled IsHoldingEnabled IsHoldingEnabled

Inherited from UIElement

IsHoldingEnabledProperty IsHoldingEnabledProperty IsHoldingEnabledProperty IsHoldingEnabledProperty

Inherited from UIElement

IsItemsHost IsItemsHost IsItemsHost IsItemsHost

Inherited from Panel

IsItemsHostProperty IsItemsHostProperty IsItemsHostProperty IsItemsHostProperty

Inherited from Panel

IsRightTapEnabled IsRightTapEnabled IsRightTapEnabled IsRightTapEnabled

Inherited from UIElement

IsRightTapEnabledProperty IsRightTapEnabledProperty IsRightTapEnabledProperty IsRightTapEnabledProperty

Inherited from UIElement

IsTapEnabled IsTapEnabled IsTapEnabled IsTapEnabled

Inherited from UIElement

IsTapEnabledProperty IsTapEnabledProperty IsTapEnabledProperty IsTapEnabledProperty

Inherited from UIElement

KeyboardAccelerators KeyboardAccelerators KeyboardAccelerators KeyboardAccelerators

Inherited from UIElement

KeyDownEvent KeyDownEvent KeyDownEvent KeyDownEvent

Inherited from UIElement

KeyTipHorizontalOffset KeyTipHorizontalOffset KeyTipHorizontalOffset KeyTipHorizontalOffset

Inherited from UIElement

KeyTipHorizontalOffsetProperty KeyTipHorizontalOffsetProperty KeyTipHorizontalOffsetProperty KeyTipHorizontalOffsetProperty

Inherited from UIElement

KeyTipPlacementMode KeyTipPlacementMode KeyTipPlacementMode KeyTipPlacementMode

Inherited from UIElement

KeyTipPlacementModeProperty KeyTipPlacementModeProperty KeyTipPlacementModeProperty KeyTipPlacementModeProperty

Inherited from UIElement

KeyTipVerticalOffset KeyTipVerticalOffset KeyTipVerticalOffset KeyTipVerticalOffset

Inherited from UIElement

KeyTipVerticalOffsetProperty KeyTipVerticalOffsetProperty KeyTipVerticalOffsetProperty KeyTipVerticalOffsetProperty

Inherited from UIElement

KeyUpEvent KeyUpEvent KeyUpEvent KeyUpEvent

Inherited from UIElement

Language Language Language Language

Inherited from FrameworkElement

LanguageProperty LanguageProperty LanguageProperty LanguageProperty

Inherited from FrameworkElement

Lights Lights Lights Lights

Inherited from UIElement

LightsProperty LightsProperty LightsProperty LightsProperty

Inherited from UIElement

LosingFocusEvent LosingFocusEvent LosingFocusEvent LosingFocusEvent

Inherited from UIElement

ManipulationCompletedEvent ManipulationCompletedEvent ManipulationCompletedEvent ManipulationCompletedEvent

Inherited from UIElement

ManipulationDeltaEvent ManipulationDeltaEvent ManipulationDeltaEvent ManipulationDeltaEvent

Inherited from UIElement

ManipulationInertiaStartingEvent ManipulationInertiaStartingEvent ManipulationInertiaStartingEvent ManipulationInertiaStartingEvent

Inherited from UIElement

ManipulationMode ManipulationMode ManipulationMode ManipulationMode

Inherited from UIElement

ManipulationModeProperty ManipulationModeProperty ManipulationModeProperty ManipulationModeProperty

Inherited from UIElement

ManipulationStartedEvent ManipulationStartedEvent ManipulationStartedEvent ManipulationStartedEvent

Inherited from UIElement

ManipulationStartingEvent ManipulationStartingEvent ManipulationStartingEvent ManipulationStartingEvent

Inherited from UIElement

Margin Margin Margin Margin

Inherited from FrameworkElement

MarginProperty MarginProperty MarginProperty MarginProperty

Inherited from FrameworkElement

MaxHeight MaxHeight MaxHeight MaxHeight

Inherited from FrameworkElement

MaxHeightProperty MaxHeightProperty MaxHeightProperty MaxHeightProperty

Inherited from FrameworkElement

MaxWidth MaxWidth MaxWidth MaxWidth

Inherited from FrameworkElement

MaxWidthProperty MaxWidthProperty MaxWidthProperty MaxWidthProperty

Inherited from FrameworkElement

MinHeight MinHeight MinHeight MinHeight

Inherited from FrameworkElement

MinHeightProperty MinHeightProperty MinHeightProperty MinHeightProperty

Inherited from FrameworkElement

MinWidth MinWidth MinWidth MinWidth

Inherited from FrameworkElement

MinWidthProperty MinWidthProperty MinWidthProperty MinWidthProperty

Inherited from FrameworkElement

Name Name Name Name

Inherited from FrameworkElement

NameProperty NameProperty NameProperty NameProperty

Inherited from FrameworkElement

NoFocusCandidateFoundEvent NoFocusCandidateFoundEvent NoFocusCandidateFoundEvent NoFocusCandidateFoundEvent

Inherited from UIElement

Opacity Opacity Opacity Opacity

Inherited from UIElement

OpacityProperty OpacityProperty OpacityProperty OpacityProperty

Inherited from UIElement

Padding Padding Padding Padding

Inherited from Grid

PaddingProperty PaddingProperty PaddingProperty PaddingProperty

Inherited from Grid

Parent Parent Parent Parent

Inherited from FrameworkElement

PointerCanceledEvent PointerCanceledEvent PointerCanceledEvent PointerCanceledEvent

Inherited from UIElement

PointerCaptureLostEvent PointerCaptureLostEvent PointerCaptureLostEvent PointerCaptureLostEvent

Inherited from UIElement

PointerCaptures PointerCaptures PointerCaptures PointerCaptures

Inherited from UIElement

PointerCapturesProperty PointerCapturesProperty PointerCapturesProperty PointerCapturesProperty

Inherited from UIElement

PointerEnteredEvent PointerEnteredEvent PointerEnteredEvent PointerEnteredEvent

Inherited from UIElement

PointerExitedEvent PointerExitedEvent PointerExitedEvent PointerExitedEvent

Inherited from UIElement

PointerMovedEvent PointerMovedEvent PointerMovedEvent PointerMovedEvent

Inherited from UIElement

PointerPressedEvent PointerPressedEvent PointerPressedEvent PointerPressedEvent

Inherited from UIElement

PointerReleasedEvent PointerReleasedEvent PointerReleasedEvent PointerReleasedEvent

Inherited from UIElement

PointerWheelChangedEvent PointerWheelChangedEvent PointerWheelChangedEvent PointerWheelChangedEvent

Inherited from UIElement

PreviewKeyDownEvent PreviewKeyDownEvent PreviewKeyDownEvent PreviewKeyDownEvent

Inherited from UIElement

PreviewKeyUpEvent PreviewKeyUpEvent PreviewKeyUpEvent PreviewKeyUpEvent

Inherited from UIElement

Projection Projection Projection Projection

Inherited from UIElement

ProjectionProperty ProjectionProperty ProjectionProperty ProjectionProperty

Inherited from UIElement

RenderSize RenderSize RenderSize RenderSize

Inherited from UIElement

RenderTransform RenderTransform RenderTransform RenderTransform

Inherited from UIElement

RenderTransformOrigin RenderTransformOrigin RenderTransformOrigin RenderTransformOrigin

Inherited from UIElement

RenderTransformOriginProperty RenderTransformOriginProperty RenderTransformOriginProperty RenderTransformOriginProperty

Inherited from UIElement

RenderTransformProperty RenderTransformProperty RenderTransformProperty RenderTransformProperty

Inherited from UIElement

RequestedTheme RequestedTheme RequestedTheme RequestedTheme

Inherited from FrameworkElement

RequestedThemeProperty RequestedThemeProperty RequestedThemeProperty RequestedThemeProperty

Inherited from FrameworkElement

Resources Resources Resources Resources

Inherited from FrameworkElement

RightTappedEvent RightTappedEvent RightTappedEvent RightTappedEvent

Inherited from UIElement

RowDefinitions RowDefinitions RowDefinitions RowDefinitions

Inherited from Grid

RowProperty RowProperty RowProperty RowProperty

Inherited from Grid

RowSpacing RowSpacing RowSpacing RowSpacing

Inherited from Grid

RowSpacingProperty RowSpacingProperty RowSpacingProperty RowSpacingProperty

Inherited from Grid

RowSpanProperty RowSpanProperty RowSpanProperty RowSpanProperty

Inherited from Grid

Style Style Style Style

Inherited from FrameworkElement

StyleProperty StyleProperty StyleProperty StyleProperty

Inherited from FrameworkElement

TabFocusNavigation TabFocusNavigation TabFocusNavigation TabFocusNavigation

Inherited from UIElement

TabFocusNavigationProperty TabFocusNavigationProperty TabFocusNavigationProperty TabFocusNavigationProperty

Inherited from UIElement

Tag Tag Tag Tag

Inherited from FrameworkElement

TagProperty TagProperty TagProperty TagProperty

Inherited from FrameworkElement

TappedEvent TappedEvent TappedEvent TappedEvent

Inherited from UIElement

Transform3D Transform3D Transform3D Transform3D

Inherited from UIElement

Transform3DProperty Transform3DProperty Transform3DProperty Transform3DProperty

Inherited from UIElement

Transitions Transitions Transitions Transitions

Inherited from UIElement

TransitionsProperty TransitionsProperty TransitionsProperty TransitionsProperty

Inherited from UIElement

Triggers Triggers Triggers Triggers

Inherited from FrameworkElement

UseLayoutRounding UseLayoutRounding UseLayoutRounding UseLayoutRounding

Inherited from UIElement

UseLayoutRoundingProperty UseLayoutRoundingProperty UseLayoutRoundingProperty UseLayoutRoundingProperty

Inherited from UIElement

VerticalAlignment VerticalAlignment VerticalAlignment VerticalAlignment

Inherited from FrameworkElement

VerticalAlignmentProperty VerticalAlignmentProperty VerticalAlignmentProperty VerticalAlignmentProperty

Inherited from FrameworkElement

Visibility Visibility Visibility Visibility

Inherited from UIElement

VisibilityProperty VisibilityProperty VisibilityProperty VisibilityProperty

Inherited from UIElement

Width Width Width Width

Inherited from FrameworkElement

WidthProperty WidthProperty WidthProperty WidthProperty

Inherited from FrameworkElement

XYFocusDownNavigationStrategy XYFocusDownNavigationStrategy XYFocusDownNavigationStrategy XYFocusDownNavigationStrategy

Inherited from UIElement

XYFocusDownNavigationStrategyProperty XYFocusDownNavigationStrategyProperty XYFocusDownNavigationStrategyProperty XYFocusDownNavigationStrategyProperty

Inherited from UIElement

XYFocusKeyboardNavigation XYFocusKeyboardNavigation XYFocusKeyboardNavigation XYFocusKeyboardNavigation

Inherited from UIElement

XYFocusKeyboardNavigationProperty XYFocusKeyboardNavigationProperty XYFocusKeyboardNavigationProperty XYFocusKeyboardNavigationProperty

Inherited from UIElement

XYFocusLeftNavigationStrategy XYFocusLeftNavigationStrategy XYFocusLeftNavigationStrategy XYFocusLeftNavigationStrategy

Inherited from UIElement

XYFocusLeftNavigationStrategyProperty XYFocusLeftNavigationStrategyProperty XYFocusLeftNavigationStrategyProperty XYFocusLeftNavigationStrategyProperty

Inherited from UIElement

XYFocusRightNavigationStrategy XYFocusRightNavigationStrategy XYFocusRightNavigationStrategy XYFocusRightNavigationStrategy

Inherited from UIElement

XYFocusRightNavigationStrategyProperty XYFocusRightNavigationStrategyProperty XYFocusRightNavigationStrategyProperty XYFocusRightNavigationStrategyProperty

Inherited from UIElement

XYFocusUpNavigationStrategy XYFocusUpNavigationStrategy XYFocusUpNavigationStrategy XYFocusUpNavigationStrategy

Inherited from UIElement

XYFocusUpNavigationStrategyProperty XYFocusUpNavigationStrategyProperty XYFocusUpNavigationStrategyProperty XYFocusUpNavigationStrategyProperty

Inherited from UIElement

Methods

CreateCoreIndependentInputSource(CoreInputDeviceTypes) CreateCoreIndependentInputSource(CoreInputDeviceTypes) CreateCoreIndependentInputSource(CoreInputDeviceTypes) CreateCoreIndependentInputSource(CoreInputDeviceTypes)

Creates a core input object that handles the input types as specified by the deviceTypes parameter. This core input object can process input events on a background thread.

public : CoreIndependentInputSource CreateCoreIndependentInputSource(CoreInputDeviceTypes deviceTypes)
public CoreIndependentInputSource CreateCoreIndependentInputSource(CoreInputDeviceTypes deviceTypes)
Public Function CreateCoreIndependentInputSource(deviceTypes As CoreInputDeviceTypes) As CoreIndependentInputSource
var coreIndependentInputSource = swapChainPanel.createCoreIndependentInputSource(deviceTypes);
Parameters
deviceTypes
CoreInputDeviceTypes CoreInputDeviceTypes CoreInputDeviceTypes CoreInputDeviceTypes

A combined value of the enumeration.

Returns

An object that represents the input subsystem for interoperation purposes and can be used for input event connection points.

Remarks

This method enables an app that includes a SwapChainPanel to handle input and rendering independent of the XAML UI thread, because you're deliberately providing the input processing logic on a background thread. You must call CreateCoreIndependentInputSource from a non-UI thread, otherwise this method will fail.

Use the CreateCoreIndependentInputSource method to create a core input object and associate it with your SwapChainPanel. Upon successful creation, user input of the specified device types that accesses SwapChainPanel contents will be redirected to the thread that CreateCoreIndependentInputSource was called from. Your app can handle this input by registering for input events and processing those events on a background thread. In order to receive input messages through the CoreIndependentInputSource object, the app code must set a swap chain on the SwapChainPanel, and render (at a Microsoft DirectX level) from this swap chain at least once. That provides the rendering that makes hit testing possible.

You typically use CoreDispatcher::ProcessEvents as part of the event handling. Get a CoreDispatcher reference from CoreIndependentInputSource::Dispatcher. For more info on how to use background threads, see ThreadPool or Threading and async programming.

You can call CreateCoreIndependentInputSource multiple times. Each time CreateCoreIndependentInputSource is called, the previous CoreIndependentInputSource object is disassociated with the SwapChainPanel. In other words, only one CoreIndependentInputSource object can get events at a time.

For example code of how to use CreateCoreIndependentInputSource, see the DrawingPanel class definition that is part of the XAML SwapChainPanel DirectX interop sample.

CreateCoreIndependentInputSource d can return null if deviceTypes was passed as CoreInputDeviceTypes.None (that's not a typical way to call CreateCoreIndependentInputSource though).

See Also

AddHandler(RoutedEvent,Object,Boolean) AddHandler(RoutedEvent,Object,Boolean) AddHandler(RoutedEvent,Object,Boolean) AddHandler(RoutedEvent,Object,Boolean)

Inherited from UIElement

Arrange(Rect) Arrange(Rect) Arrange(Rect) Arrange(Rect)

Inherited from UIElement

ArrangeOverride(Size) ArrangeOverride(Size) ArrangeOverride(Size) ArrangeOverride(Size)

Inherited from FrameworkElement

CancelDirectManipulations CancelDirectManipulations CancelDirectManipulations CancelDirectManipulations

Inherited from UIElement

CapturePointer(Pointer) CapturePointer(Pointer) CapturePointer(Pointer) CapturePointer(Pointer)

Inherited from UIElement

ClearValue(DependencyProperty) ClearValue(DependencyProperty) ClearValue(DependencyProperty) ClearValue(DependencyProperty)

Inherited from DependencyObject

DeferTree(DependencyObject) DeferTree(DependencyObject) DeferTree(DependencyObject) DeferTree(DependencyObject)

Inherited from FrameworkElement

FindName(String) FindName(String) FindName(String) FindName(String)

Inherited from FrameworkElement

FindSubElementsForTouchTargeting(Point,Rect) FindSubElementsForTouchTargeting(Point,Rect) FindSubElementsForTouchTargeting(Point,Rect) FindSubElementsForTouchTargeting(Point,Rect)

Inherited from UIElement

GetAnimationBaseValue(DependencyProperty) GetAnimationBaseValue(DependencyProperty) GetAnimationBaseValue(DependencyProperty) GetAnimationBaseValue(DependencyProperty)

Inherited from DependencyObject

GetBindingExpression(DependencyProperty) GetBindingExpression(DependencyProperty) GetBindingExpression(DependencyProperty) GetBindingExpression(DependencyProperty)

Inherited from FrameworkElement

GetChildrenInTabFocusOrder GetChildrenInTabFocusOrder GetChildrenInTabFocusOrder GetChildrenInTabFocusOrder

Inherited from UIElement

GetColumn(FrameworkElement) GetColumn(FrameworkElement) GetColumn(FrameworkElement) GetColumn(FrameworkElement)

Inherited from Grid

GetColumnSpan(FrameworkElement) GetColumnSpan(FrameworkElement) GetColumnSpan(FrameworkElement) GetColumnSpan(FrameworkElement)

Inherited from Grid

GetRow(FrameworkElement) GetRow(FrameworkElement) GetRow(FrameworkElement) GetRow(FrameworkElement)

Inherited from Grid

GetRowSpan(FrameworkElement) GetRowSpan(FrameworkElement) GetRowSpan(FrameworkElement) GetRowSpan(FrameworkElement)

Inherited from Grid

GetValue(DependencyProperty) GetValue(DependencyProperty) GetValue(DependencyProperty) GetValue(DependencyProperty)

Inherited from DependencyObject

GoToElementStateCore(String,Boolean) GoToElementStateCore(String,Boolean) GoToElementStateCore(String,Boolean) GoToElementStateCore(String,Boolean)

Inherited from FrameworkElement

InvalidateArrange InvalidateArrange InvalidateArrange InvalidateArrange

Inherited from UIElement

InvalidateMeasure InvalidateMeasure InvalidateMeasure InvalidateMeasure

Inherited from UIElement

Measure(Size) Measure(Size) Measure(Size) Measure(Size)

Inherited from UIElement

MeasureOverride(Size) MeasureOverride(Size) MeasureOverride(Size) MeasureOverride(Size)

Inherited from FrameworkElement

OnApplyTemplate OnApplyTemplate OnApplyTemplate OnApplyTemplate

Inherited from FrameworkElement

OnCreateAutomationPeer OnCreateAutomationPeer OnCreateAutomationPeer OnCreateAutomationPeer

Inherited from UIElement

OnDisconnectVisualChildren OnDisconnectVisualChildren OnDisconnectVisualChildren OnDisconnectVisualChildren

Inherited from UIElement

OnProcessKeyboardAccelerators(ProcessKeyboardAcceleratorEventArgs) OnProcessKeyboardAccelerators(ProcessKeyboardAcceleratorEventArgs) OnProcessKeyboardAccelerators(ProcessKeyboardAcceleratorEventArgs) OnProcessKeyboardAccelerators(ProcessKeyboardAcceleratorEventArgs)

Inherited from UIElement

ReadLocalValue(DependencyProperty) ReadLocalValue(DependencyProperty) ReadLocalValue(DependencyProperty) ReadLocalValue(DependencyProperty)

Inherited from DependencyObject

RegisterPropertyChangedCallback(DependencyProperty,DependencyPropertyChangedCallback) RegisterPropertyChangedCallback(DependencyProperty,DependencyPropertyChangedCallback) RegisterPropertyChangedCallback(DependencyProperty,DependencyPropertyChangedCallback) RegisterPropertyChangedCallback(DependencyProperty,DependencyPropertyChangedCallback)

Inherited from DependencyObject

ReleasePointerCapture(Pointer) ReleasePointerCapture(Pointer) ReleasePointerCapture(Pointer) ReleasePointerCapture(Pointer)

Inherited from UIElement

ReleasePointerCaptures ReleasePointerCaptures ReleasePointerCaptures ReleasePointerCaptures

Inherited from UIElement

RemoveHandler(RoutedEvent,Object) RemoveHandler(RoutedEvent,Object) RemoveHandler(RoutedEvent,Object) RemoveHandler(RoutedEvent,Object)

Inherited from UIElement

SetBinding(DependencyProperty,BindingBase) SetBinding(DependencyProperty,BindingBase) SetBinding(DependencyProperty,BindingBase) SetBinding(DependencyProperty,BindingBase)

Inherited from FrameworkElement

SetColumn(FrameworkElement,Int32) SetColumn(FrameworkElement,Int32) SetColumn(FrameworkElement,Int32) SetColumn(FrameworkElement,Int32)

Inherited from Grid

SetColumnSpan(FrameworkElement,Int32) SetColumnSpan(FrameworkElement,Int32) SetColumnSpan(FrameworkElement,Int32) SetColumnSpan(FrameworkElement,Int32)

Inherited from Grid

SetRow(FrameworkElement,Int32) SetRow(FrameworkElement,Int32) SetRow(FrameworkElement,Int32) SetRow(FrameworkElement,Int32)

Inherited from Grid

SetRowSpan(FrameworkElement,Int32) SetRowSpan(FrameworkElement,Int32) SetRowSpan(FrameworkElement,Int32) SetRowSpan(FrameworkElement,Int32)

Inherited from Grid

SetValue(DependencyProperty,Object) SetValue(DependencyProperty,Object) SetValue(DependencyProperty,Object) SetValue(DependencyProperty,Object)

Inherited from DependencyObject

StartBringIntoView StartBringIntoView StartBringIntoView StartBringIntoView

Inherited from UIElement

StartBringIntoView(BringIntoViewOptions) StartBringIntoView(BringIntoViewOptions) StartBringIntoView(BringIntoViewOptions) StartBringIntoView(BringIntoViewOptions)

Inherited from UIElement

StartDragAsync(PointerPoint) StartDragAsync(PointerPoint) StartDragAsync(PointerPoint) StartDragAsync(PointerPoint)

Inherited from UIElement

TransformToVisual(UIElement) TransformToVisual(UIElement) TransformToVisual(UIElement) TransformToVisual(UIElement)

Inherited from UIElement

TryInvokeKeyboardAccelerator(ProcessKeyboardAcceleratorEventArgs) TryInvokeKeyboardAccelerator(ProcessKeyboardAcceleratorEventArgs) TryInvokeKeyboardAccelerator(ProcessKeyboardAcceleratorEventArgs) TryInvokeKeyboardAccelerator(ProcessKeyboardAcceleratorEventArgs)

Inherited from UIElement

TryStartDirectManipulation(Pointer) TryStartDirectManipulation(Pointer) TryStartDirectManipulation(Pointer) TryStartDirectManipulation(Pointer)

Inherited from UIElement

UnregisterPropertyChangedCallback(DependencyProperty,Int64) UnregisterPropertyChangedCallback(DependencyProperty,Int64) UnregisterPropertyChangedCallback(DependencyProperty,Int64) UnregisterPropertyChangedCallback(DependencyProperty,Int64)

Inherited from DependencyObject

UpdateLayout UpdateLayout UpdateLayout UpdateLayout

Inherited from UIElement

Events

CompositionScaleChanged CompositionScaleChanged CompositionScaleChanged CompositionScaleChanged

Occurs when the composition scale factor of the SwapChainPanel has changed.

public : event TypedEventHandler CompositionScaleChanged<SwapChainPanel,  object>
public event TypedEventHandler CompositionScaleChanged<SwapChainPanel,  object>
Public Event TypedEventHandler CompositionScaleChanged( Of ( Of SwapChainPanel ), ( Of  object ))
function onCompositionScaleChanged(eventArgs){/* Your code */}


swapChainPanel.addEventListener("compositionScaleChanged", onCompositionScaleChanged);
swapChainPanel.removeEventListener("compositionScaleChanged", onCompositionScaleChanged);
<SwapChainPanel CompositionScaleChanged="eventhandler"/>

Remarks

The supplier of the swap chain content might need to resize their content if a layout pass determines a new size for the panel or containers it's within, or if a RenderTransform is applied on the SwapChainPanel or any of its ancestors. Changes of this nature aren't always originated by app logic that's easy to detect from other events (for example the user might change a device orientation or a view state that causes layout to rerun), so this event provides a notification specifically for the scenario of changing the swap chain content size, which would typically invert the scale factors applied.

Check CompositionScaleX and CompositionScaleY any time you are handling CompositionScaleChanged (CompositionScaleChanged doesn't have event data, but if it fires it means that one or both properties have changed values on this SwapChainPanel ).

This event fires asynchronously versus the originating change. For example, dynamic animations or manipulations might affect the scale factor, and the event is raised when those dynamic changes are completed.

AccessKeyDisplayDismissed AccessKeyDisplayDismissed AccessKeyDisplayDismissed AccessKeyDisplayDismissed

Inherited from UIElement

AccessKeyDisplayRequested AccessKeyDisplayRequested AccessKeyDisplayRequested AccessKeyDisplayRequested

Inherited from UIElement

AccessKeyInvoked AccessKeyInvoked AccessKeyInvoked AccessKeyInvoked

Inherited from UIElement

ActualThemeChanged ActualThemeChanged ActualThemeChanged ActualThemeChanged

Inherited from FrameworkElement

CharacterReceived CharacterReceived CharacterReceived CharacterReceived

Inherited from UIElement

ContextCanceled ContextCanceled ContextCanceled ContextCanceled

Inherited from UIElement

ContextRequested ContextRequested ContextRequested ContextRequested

Inherited from UIElement

DataContextChanged DataContextChanged DataContextChanged DataContextChanged

Inherited from FrameworkElement

DoubleTapped DoubleTapped DoubleTapped DoubleTapped

Inherited from UIElement

DragEnter DragEnter DragEnter DragEnter

Inherited from UIElement

DragLeave DragLeave DragLeave DragLeave

Inherited from UIElement

DragOver DragOver DragOver DragOver

Inherited from UIElement

DragStarting DragStarting DragStarting DragStarting

Inherited from UIElement

Drop Drop Drop Drop

Inherited from UIElement

DropCompleted DropCompleted DropCompleted DropCompleted

Inherited from UIElement

GettingFocus GettingFocus GettingFocus GettingFocus

Inherited from UIElement

GotFocus GotFocus GotFocus GotFocus

Inherited from UIElement

Holding Holding Holding Holding

Inherited from UIElement

KeyDown KeyDown KeyDown KeyDown

Inherited from UIElement

KeyUp KeyUp KeyUp KeyUp

Inherited from UIElement

LayoutUpdated LayoutUpdated LayoutUpdated LayoutUpdated

Inherited from FrameworkElement

Loaded Loaded Loaded Loaded

Inherited from FrameworkElement

Loading Loading Loading Loading

Inherited from FrameworkElement

LosingFocus LosingFocus LosingFocus LosingFocus

Inherited from UIElement

LostFocus LostFocus LostFocus LostFocus

Inherited from UIElement

ManipulationCompleted ManipulationCompleted ManipulationCompleted ManipulationCompleted

Inherited from UIElement

ManipulationDelta ManipulationDelta ManipulationDelta ManipulationDelta

Inherited from UIElement

ManipulationInertiaStarting ManipulationInertiaStarting ManipulationInertiaStarting ManipulationInertiaStarting

Inherited from UIElement

ManipulationStarted ManipulationStarted ManipulationStarted ManipulationStarted

Inherited from UIElement

ManipulationStarting ManipulationStarting ManipulationStarting ManipulationStarting

Inherited from UIElement

NoFocusCandidateFound NoFocusCandidateFound NoFocusCandidateFound NoFocusCandidateFound

Inherited from UIElement

PointerCanceled PointerCanceled PointerCanceled PointerCanceled

Inherited from UIElement

PointerCaptureLost PointerCaptureLost PointerCaptureLost PointerCaptureLost

Inherited from UIElement

PointerEntered PointerEntered PointerEntered PointerEntered

Inherited from UIElement

PointerExited PointerExited PointerExited PointerExited

Inherited from UIElement

PointerMoved PointerMoved PointerMoved PointerMoved

Inherited from UIElement

PointerPressed PointerPressed PointerPressed PointerPressed

Inherited from UIElement

PointerReleased PointerReleased PointerReleased PointerReleased

Inherited from UIElement

PointerWheelChanged PointerWheelChanged PointerWheelChanged PointerWheelChanged

Inherited from UIElement

PreviewKeyDown PreviewKeyDown PreviewKeyDown PreviewKeyDown

Inherited from UIElement

PreviewKeyUp PreviewKeyUp PreviewKeyUp PreviewKeyUp

Inherited from UIElement

ProcessKeyboardAccelerators ProcessKeyboardAccelerators ProcessKeyboardAccelerators ProcessKeyboardAccelerators

Inherited from UIElement

RightTapped RightTapped RightTapped RightTapped

Inherited from UIElement

SizeChanged SizeChanged SizeChanged SizeChanged

Inherited from FrameworkElement

Tapped Tapped Tapped Tapped

Inherited from UIElement

Unloaded Unloaded Unloaded Unloaded

Inherited from FrameworkElement

See Also