SwapChainPanel Class

호스팅 화면을 제공합니다. 여기서 Microsoft DirectX 스왑 체인이 XAML UI로 렌더링할 수 있는 콘텐츠를 제공합니다. SwapChainPanel 요소는 DirectX 그래픽을 렌더링하여 XAML 페이지 내에 시각 효과를 표시하는 앱의 핵심 구성 요소입니다.

상속

Object
  DependencyObject
    UIElement
      FrameworkElement
        Panel
          Grid
            SwapChainPanel

구문


public class SwapChainPanel : Grid


<SwapChainPanel .../>

특성

[MarshalingBehavior(Agile)]
[Threading(Both)]
[Version(0x06030000)]
[WebHostHidden()]

멤버

SwapChainPanel클래스에는 다음과 같은 형식의 멤버가 있습니다.

생성자

SwapChainPanel클래스에는 다음과 같은 생성자가 있습니다.

생성자Description
SwapChainPanel Initializes a new instance of the SwapChainPanel class.

 

이벤트

SwapChainPanel클래스에는 다음과 같은 이벤트가 있습니다.

이벤트Description
CompositionScaleChanged Occurs when the composition scale factor of the SwapChainPanel has changed.
DataContextChanged Occurs when the value of the FrameworkElement.DataContext property changes. (다음에서 상속됨 FrameworkElement)
DoubleTapped Occurs when an otherwise unhandled DoubleTap interaction occurs over the hit test area of this element. (다음에서 상속됨 UIElement)
DragEnter Occurs when the input system reports an underlying drag event with this element as the target. (다음에서 상속됨 UIElement)
DragLeave Occurs when the input system reports an underlying drag event with this element as the origin. (다음에서 상속됨 UIElement)
DragOver Occurs when the input system reports an underlying drag event with this element as the potential drop target. (다음에서 상속됨 UIElement)
Drop Occurs when the input system reports an underlying drop event with this element as the drop target. (다음에서 상속됨 UIElement)
GotFocus Occurs when a UIElement receives focus. (다음에서 상속됨 UIElement)
Holding Occurs when an otherwise unhandled Hold interaction occurs over the hit test area of this element. (다음에서 상속됨 UIElement)
KeyDown Occurs when a keyboard key is pressed while the UIElement has focus. (다음에서 상속됨 UIElement)
KeyUp Occurs when a keyboard key is released while the UIElement has focus. (다음에서 상속됨 UIElement)
LayoutUpdated Occurs when the layout of the visual tree changes, due to layout-relevant properties changing value or some other action that refreshes the layout. (다음에서 상속됨 FrameworkElement)
Loaded Occurs when a FrameworkElement has been constructed and added to the object tree, and is ready for interaction. (다음에서 상속됨 FrameworkElement)
LostFocus Occurs when a UIElement loses focus. (다음에서 상속됨 UIElement)
ManipulationCompleted Occurs when a manipulation on the UIElement is complete. (다음에서 상속됨 UIElement)
ManipulationDelta Occurs when the input device changes position during a manipulation. (다음에서 상속됨 UIElement)
ManipulationInertiaStarting Occurs when the input device loses contact with the UIElement object during a manipulation and inertia begins. (다음에서 상속됨 UIElement)
ManipulationStarted Occurs when an input device begins a manipulation on the UIElement. (다음에서 상속됨 UIElement)
ManipulationStarting Occurs when the manipulation processor is first created. (다음에서 상속됨 UIElement)
PointerCanceled Occurs when a pointer that made contact abnormally loses contact. (다음에서 상속됨 UIElement)
PointerCaptureLost Occurs when pointer capture previously held by this element moves to another element or elsewhere. (다음에서 상속됨 UIElement)
PointerEntered Occurs when a pointer enters the hit test area of this element. (다음에서 상속됨 UIElement)
PointerExited Occurs when a pointer leaves the hit test area of this element. (다음에서 상속됨 UIElement)
PointerMoved Occurs when a pointer moves while the pointer remains within the hit test area of this element. (다음에서 상속됨 UIElement)
PointerPressed Occurs when the pointer device initiates a Press action within this element. (다음에서 상속됨 UIElement)
PointerReleased Occurs when the pointer device that previously initiated a Press action is released, while within this element. (다음에서 상속됨 UIElement)
PointerWheelChanged Occurs when the delta value of a pointer wheel changes. (다음에서 상속됨 UIElement)
RightTapped Occurs when a right-tap input stimulus happens while the pointer is over the element. (다음에서 상속됨 UIElement)
SizeChanged Occurs when either the ActualHeight or the ActualWidth property changes value on a FrameworkElement. (다음에서 상속됨 FrameworkElement)
Tapped Occurs when an otherwise unhandled Tap interaction occurs over the hit test area of this element. (다음에서 상속됨 UIElement)
Unloaded Occurs when this object is no longer connected to the main object tree. (다음에서 상속됨 FrameworkElement)

 

메서드

The SwapChainPanel 클래스 - 이러한 메서드가 있습니다. 다음 위치의 메서드도 상속합니다. Object 클래스.

메서드Description
AddHandler Adds a routed event handler for a specified routed event, adding the handler to the handler collection on the current element. Specify handledEventsToo as true to have the provided handler be invoked even if the event is handled elsewhere. (다음에서 상속됨 UIElement)
Arrange Positions child objects and determines a size for a UIElement. Parent objects that implement custom layout for their child elements should call this method from their layout override implementations to form a recursive layout update. (다음에서 상속됨 UIElement)
ArrangeOverride Provides the behavior for the Arrange pass of layout. Classes can override this method to define their own Arrange pass behavior. (다음에서 상속됨 FrameworkElement)
CancelDirectManipulations Cancels ongoing direct manipulation processing (system-defined panning/zooming) on any ScrollViewer parent that contains the current UIElement. (다음에서 상속됨 UIElement)
CapturePointer Sets pointer capture to a UIElement. Once captured, only the element that has capture will fire pointer-related events. (다음에서 상속됨 UIElement)
ClearValue Clears the local value of a dependency property. (다음에서 상속됨 DependencyObject)
CreateCoreIndependentInputSource 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.
FindName Retrieves an object that has the specified identifier name. (다음에서 상속됨 FrameworkElement)
FindSubElementsForTouchTargeting Enables a UIElement subclass to expose child elements that assist with resolving touch targeting. (다음에서 상속됨 UIElement)
GetAnimationBaseValue Returns any base value established for a dependency property, which would apply in cases where an animation is not active. (다음에서 상속됨 DependencyObject)
GetBindingExpression Returns the BindingExpression that represents the binding on the specified property. (다음에서 상속됨 FrameworkElement)
GetValue Returns the current effective value of a dependency property from a DependencyObject. (다음에서 상속됨 DependencyObject)
GoToElementStateCore When implemented in a derived class, enables per-state construction of a visual tree for a control template in code, rather than by loading XAML for all states at control startup. (다음에서 상속됨 FrameworkElement)
InvalidateArrange Invalidates the arrange state (layout) for a UIElement. After the invalidation, the UIElement will have its layout updated, which will occur asynchronously. (다음에서 상속됨 UIElement)
InvalidateMeasure Invalidates the measurement state (layout) for a UIElement. (다음에서 상속됨 UIElement)
Measure Updates the DesiredSize of a UIElement. Typically, objects that implement custom layout for their layout children call this method from their own MeasureOverride implementations to form a recursive layout update. (다음에서 상속됨 UIElement)
MeasureOverride Provides the behavior for the Measure pass of the layout cycle. Classes can override this method to define their own Measure pass behavior. (다음에서 상속됨 FrameworkElement)
OnApplyTemplate Invoked whenever application code or internal processes (such as a rebuilding layout pass) call ApplyTemplate. In simplest terms, this means the method is called just before a UI element displays in your app. Override this method to influence the default post-template logic of a class. (다음에서 상속됨 FrameworkElement)
OnCreateAutomationPeer When implemented in a derived class, returns class-specific AutomationPeer implementations for the Microsoft UI Automation infrastructure. (다음에서 상속됨 UIElement)
OnDisconnectVisualChildren Override this method to implement how layout and logic should behave when items are removed from a class-specific content or children property. (다음에서 상속됨 UIElement)
ReadLocalValue Returns the local value of a dependency property, if a local value is set. (다음에서 상속됨 DependencyObject)
ReleasePointerCapture Releases pointer captures for capture of one specific pointer by this UIElement. (다음에서 상속됨 UIElement)
ReleasePointerCaptures Releases all pointer captures held by this element. (다음에서 상속됨 UIElement)
RemoveHandler Removes the specified routed event handler from this UIElement. Typically the handler in question was added by AddHandler. (다음에서 상속됨 UIElement)
SetBinding Attaches a binding to a FrameworkElement, using the provided binding object. (다음에서 상속됨 FrameworkElement)
SetValue Sets the local value of a dependency property on a DependencyObject. (다음에서 상속됨 DependencyObject)
TransformToVisual Returns a transform object that can be used to transform coordinates from the UIElement to the specified object. (다음에서 상속됨 UIElement)
UpdateLayout Ensures that all positions of child objects of a UIElement are properly updated for layout. (다음에서 상속됨 UIElement)

 

속성

SwapChainPanel클래스 - 이러한 속성이 있습니다.

속성사용 권한Description

ActualHeight

읽기 전용Gets the rendered height of a FrameworkElement. (다음에서 상속됨 FrameworkElement)

ActualWidth

읽기 전용Gets the rendered width of a FrameworkElement. (다음에서 상속됨 FrameworkElement)

AllowDrop

읽기/쓰기Gets or sets a value that determines whether this UIElement can be a drop target for purposes of drag-and-drop operations. (다음에서 상속됨 UIElement)

Background

읽기/쓰기Gets or sets a Brush that is used to fill the panel. (다음에서 상속됨 Panel)

BaseUri

읽기 전용Gets a Uniform Resource Identifier (URI) that represents the base Uniform Resource Identifier (URI) for an XAML-constructed object at XAML load time. This property is useful for Uniform Resource Identifier (URI) resolution at run time. (다음에서 상속됨 FrameworkElement)

CacheMode

읽기/쓰기Gets or sets a value that indicates that rendered content should be cached as a composited bitmap when possible. (다음에서 상속됨 UIElement)

Children

읽기 전용Gets the collection of child elements of the panel. (다음에서 상속됨 Panel)

ChildrenTransitions

읽기/쓰기Gets or sets the collection of Transition style elements that apply to child content of a Panel subclass. (다음에서 상속됨 Panel)

Clip

읽기/쓰기Gets or sets the RectangleGeometry used to define the outline of the contents of a UIElement. (다음에서 상속됨 UIElement)

ColumnDefinitions

읽기 전용Gets a list of ColumnDefinition objects defined on this instance of Grid. (다음에서 상속됨 Grid)

CompositeMode

읽기/쓰기Gets or sets a property that declares alternate composition and blending modes for the element in its parent layout and window. This is relevant for elements that are involved in a mixed XAML / Microsoft DirectX UI. (다음에서 상속됨 UIElement)

CompositionScaleX

읽기 전용Gets the x-axis scale factor of the SwapChainPanel.

CompositionScaleXProperty

읽기 전용Identifies the CompositionScaleX dependency property.

CompositionScaleY

읽기 전용Gets the y-axis scale factor of the SwapChainPanel.

CompositionScaleYProperty

읽기 전용Identifies the CompositionScaleY dependency property.

DataContext

읽기/쓰기Gets or sets the data context for a FrameworkElement when it participates in data binding. (다음에서 상속됨 FrameworkElement)

DesiredSize

읽기 전용Gets the size that this UIElement computed during the measure pass of the layout process. (다음에서 상속됨 UIElement)

Dispatcher

읽기 전용Gets the CoreDispatcher that this object is associated with. (다음에서 상속됨 DependencyObject)

FlowDirection

읽기/쓰기Gets or sets the direction in which text and other UI elements flow within any parent element that controls their layout. This property can be set to either LeftToRight or RightToLeft. Setting FlowDirection to RightToLeft on any element sets the alignment to the right, the reading order to right-to-left and the layout of the control to flow from right to left. (다음에서 상속됨 FrameworkElement)

Height

읽기/쓰기Gets or sets the suggested height of a FrameworkElement. (다음에서 상속됨 FrameworkElement)

HorizontalAlignment

읽기/쓰기Gets or sets the horizontal alignment characteristics that are applied to a FrameworkElement when it is composed in a layout parent, such as a panel or items control. (다음에서 상속됨 FrameworkElement)

IsDoubleTapEnabled

읽기/쓰기Gets or sets a value that determines whether the DoubleTapped event can originate from that element. (다음에서 상속됨 UIElement)

IsHitTestVisible

읽기/쓰기Gets or sets whether the contained area of this UIElement can return true values for hit testing. (다음에서 상속됨 UIElement)

IsHoldingEnabled

읽기/쓰기Gets or sets a value that determines whether the Holding event can originate from that element. (다음에서 상속됨 UIElement)

IsItemsHost

읽기 전용Gets a value that indicates whether this Panel is a container for UI items that are generated by an ItemsControl. (다음에서 상속됨 Panel)

IsRightTapEnabled

읽기/쓰기Gets or sets a value that determines whether the RightTapped event can originate from that element. (다음에서 상속됨 UIElement)

IsTapEnabled

읽기/쓰기Gets or sets a value that determines whether the Tapped event can originate from that element. (다음에서 상속됨 UIElement)

Language

읽기/쓰기Gets or sets localization/globalization language information that applies to a FrameworkElement, and also to all child elements of the current FrameworkElement in the object representation and in UI. (다음에서 상속됨 FrameworkElement)

ManipulationMode

읽기/쓰기Gets or sets the ManipulationModes value used for UIElement behavior and interaction with gestures. Setting this value enables handling the manipulation events from this element in app code. (다음에서 상속됨 UIElement)

Margin

읽기/쓰기Gets or sets the outer margin of a FrameworkElement. (다음에서 상속됨 FrameworkElement)

MaxHeight

읽기/쓰기Gets or sets the maximum height constraint of a FrameworkElement. (다음에서 상속됨 FrameworkElement)

MaxWidth

읽기/쓰기Gets or sets the maximum width constraint of a FrameworkElement. (다음에서 상속됨 FrameworkElement)

MinHeight

읽기/쓰기Gets or sets the minimum height constraint of a FrameworkElement. (다음에서 상속됨 FrameworkElement)

MinWidth

읽기/쓰기Gets or sets the minimum width constraint of a FrameworkElement. (다음에서 상속됨 FrameworkElement)

Name

읽기/쓰기Gets or sets the identifying name of the object. When a XAML processor creates the object tree from XAML markup, run-time code can refer to the XAML-declared object by this name. (다음에서 상속됨 FrameworkElement)

Opacity

읽기/쓰기Gets or sets the degree of the object's opacity. (다음에서 상속됨 UIElement)

Parent

읽기 전용Gets the parent object of this FrameworkElement in the object tree. (다음에서 상속됨 FrameworkElement)

PointerCaptures

읽기 전용Gets the set of all captured pointers, represented as Pointer values. (다음에서 상속됨 UIElement)

Projection

읽기/쓰기Gets or sets the perspective projection (3-D effect) to apply when rendering this element. (다음에서 상속됨 UIElement)

RenderSize

읽기 전용Gets the final render size of a UIElement. (다음에서 상속됨 UIElement)

RenderTransform

읽기/쓰기Gets or sets transform information that affects the rendering position of a UIElement. (다음에서 상속됨 UIElement)

RenderTransformOrigin

읽기/쓰기Gets or sets the origin point of any possible render transform declared by RenderTransform, relative to the bounds of the UIElement. (다음에서 상속됨 UIElement)

RequestedTheme

읽기/쓰기Gets or sets the UI theme that is used by the UIElement (and its child elements) for resource determination. The UI theme you specify with RequestedTheme can override the app-level RequestedTheme. (다음에서 상속됨 FrameworkElement)

Resources

읽기/쓰기Gets the locally defined resource dictionary. In XAML, you can establish resource items as child object elements of a frameworkElement.Resources property element, through XAML implicit collection syntax. (다음에서 상속됨 FrameworkElement)

RowDefinitions

읽기 전용Gets a list of RowDefinition objects defined on this instance of Grid. (다음에서 상속됨 Grid)

Style

읽기/쓰기Gets or sets an instance Style that is applied for this object during layout and rendering. (다음에서 상속됨 FrameworkElement)

Tag

읽기/쓰기Gets or sets an arbitrary object value that can be used to store custom information about this object. (다음에서 상속됨 FrameworkElement)

Transitions

읽기/쓰기Gets or sets the collection of Transition style elements that apply to a UIElement. (다음에서 상속됨 UIElement)

Triggers

읽기 전용Gets the collection of triggers for animations that are defined for a FrameworkElement. Not commonly used. (다음에서 상속됨 FrameworkElement)

UseLayoutRounding

읽기/쓰기Gets or sets a value that determines whether rendering for the object and its visual subtree should use rounding behavior that aligns rendering to whole pixels. (다음에서 상속됨 UIElement)

VerticalAlignment

읽기/쓰기Gets or sets the vertical alignment characteristics that are applied to a FrameworkElement when it is composed in a parent object such as a panel or items control. (다음에서 상속됨 FrameworkElement)

Visibility

읽기/쓰기Gets or sets the visibility of a UIElement. A UIElement that is not visible is not rendered and does not communicate its desired size to layout. (다음에서 상속됨 UIElement)

Width

읽기/쓰기Gets or sets the width of a FrameworkElement. (다음에서 상속됨 FrameworkElement)

 

설명

SwapChainPanelGrid 하위 클래스이므로 ColumnDefinitionsRowDefinitions 속성을 사용하여 패널의 특성을 선언하고, 자식 요소의 Grid.RowGrid.Column과 같은 Grid의 연결된 속성을 사용하여 해당 자식 요소를 레이아웃에 배치할 수 있습니다.

SwapChainPanel을 사용하는 코드 예제는 XAML SwapChainPanel DirectX interop 샘플을 참조하십시오. DirectX Windows 스토어 앱 개발 환경 준비를 참조하십시오.

SwapChainPanel 클래스는 Control 클래스에서 상속하지 않기 때문에 키 이벤트 캡처에 프로그래밍 방식으로 바로 사용할 수 없습니다. 패널 내부의 포커스 설정 가능한 요소에 포커스를 설정하고 키 이벤트 버블을 허용하는 것이 좋습니다.

선명한 벡터 렌더링을 유지하려면 CompositionScaleChanged 이벤트를 수신하며, CompositionScaleXCompositionScaleY 속성 값을 쿼리하여 현재 UI 배율을 고려하고 잠재적으로 render again from DirectX해야 합니다. 그렇지 않으면 XAML 레이아웃에서 크기 조정을 수행하므로 시각적 요소가 저하될 수 있습니다.

SwapChainPanel 요소 초기화

SwapChainPanel에서 콘텐츠를 렌더링하려면 먼저 DirectX 쪽에서 초기화해야 합니다.

SwapChainPanel 인스턴스를 IInspectable 또는 IUnknown으로 캐스트한 다음 QueryInterface를 호출하여 ISwapChainPanelNative 인터페이스에 대한 참조를 가져옵니다(SwapChainPanel을 보완하고 interop 브리지를 활성화하는 기본 인터페이스 구현임). 해당 참조에서 ISwapChainPanelNative::SetSwapChain을 호출하여 구현된 스왑 체인을 SwapChainPanel 인스턴스에 연결합니다.

인터페이스를 쿼리하고 스왑 체인을 Create*Resources 메서드의 일부로 설정하는 코드를 넣는 것이 일반적입니다. Create*Resources 메서드는 DirectX Renderer 클래스 템플릿/예제에서 볼 수 있는 구현 패턴이며, SDK 샘플과 Microsoft Visual Studio의 DirectX(XAML) 프로젝트 템플릿에서 가져온 코드에서도 이 구현 패턴을 볼 수 있습니다. 특히 DirectX(XAML) 프로젝트 템플릿에서는 QueryInterface 호출 및 DeviceResources.cpp의 DeviceResources::CreateWindowSizeDependentResources 메서드 구현의 ISwapChainPanelNative::SetSwapChain에 대한 호출을 볼 수 있습니다.

SwapChain을 기존 SwapChainPanel에 추가할 수 있게 해 주는 API는 런타임 클래스 API가 아니라 DirectX API입니다. 스왑 체인 입력을 DirectX 인터페이스(IDXGISwapChain)로 구현합니다.

SwapChainPanelSwapChainBackgroundPanel

SwapChainPanelSwapChainBackgroundPanel보다 UI 배치 및 상호 작용이 덜 제한적입니다.

  • SwapChainPanel은 페이지의 시각적 트리 내 어디에서든 컨트롤로 사용할 수 있습니다. SwapChainBackgroundPanel은 루트 요소일 수만 있습니다.
  • Grid 기본 클래스에서 상속된 일반적인 XAML UI API는 SwapChainPanel에 사용할 수 있습니다. SwapChainBackgroundPanel에서는 대부분의 Grid 상속 API를 설정할 수 없습니다.
  • 새로운 앱에서는 일반적으로 SwapChainPanel을 사용해야 하며 SwapChainBackgroundPanel을 Windows 8.1에서는 업데이트되지 않은 Windows 8 앱의 기존 기술로 간주해야 합니다.

스왑 체인

  • 스왑 체인은 주 UI 스레드에서 실행해야 합니다. 이 작업은 일반적으로 XAML 개체 요소로 초기화된 참조에서 SetSwapChain을 호출하여 수행됩니다.
  • 단일 스왑 체인을 여러 SwapChainPanel 요소에 연결할 수 있습니다. 또는 앱이 별도의 SwapChainPanel에 대한 프레젠테이션을 각각 제공하는 여러 스왑 체인을 가질 수 있습니다.
  • 그러나 많은 스왑 체인을 동시에 업데이트할 경우 성능이 저하될 수 있습니다. 앱에서 4개 이하의 스왑 체인을 사용하는 것이 좋습니다.
  • 스왑 체인을 통해 렌더링되는 콘텐츠는 사용자가 크기를 조정해도 크기가 늘어나지 않습니다. 이 크기 조정 동작은 Image 요소에서 Stretch="None"을 설정하는 것과 비슷합니다.
  • XAML로 작성된 요소가 아닌 앱의 핵심 창으로 바로 이동하는 스왑 체인 콘텐츠를 렌더링하는 다른 기술이 있습니다. CreateSwapChainForCoreWindow를 참조하십시오.

백그라운드 스레드에서 입력 처리

CreateCoreIndependentInputSource 메서드를 사용하면 앱이 하나 이상의 백그라운드 스레드에서 입력을 처리하여 SwapChainPanel에 완전히 렌더링할 수 있습니다. 이를 통해 XAML UI 스레드와 독립적으로 뛰어난 성능의 입력 및 렌더링을 유지할 수 있습니다.

요구 사항

지원되는 최소 클라이언트

Windows 8.1 [Windows 스토어 앱만]

지원되는 최소 서버

Windows Server 2012 R2 [Windows 스토어 앱만]

Namespace

Windows.UI.Xaml.Controls
Windows::UI::Xaml::Controls [C++]

Metadata

Windows.winmd

참고 항목

Grid
SwapChainBackgroundPanel
ISwapChainPanelNative
DirectX 및 XAML interop
XAML SwapChainPanel DirectX interop 샘플
DirectX Windows 스토어 앱 개발 환경 준비

 

 

표시:
© 2015 Microsoft