Click or drag to resize
CanvasSwapChainPanel Class
A swap chain panel is a XAML control which draws to a swap chain.
Inheritance Hierarchy
SystemObject
  Windows.UI.Xaml.ControlsSwapChainPanel
    Microsoft.Graphics.Canvas.UI.XamlCanvasSwapChainPanel

Namespace:  Microsoft.Graphics.Canvas.UI.Xaml
Assembly:  Microsoft.Graphics.Canvas (in Microsoft.Graphics.Canvas.dll) Version: 0.0.0.0
Syntax
C#
public sealed class CanvasSwapChainPanel : SwapChainPanel, 
	IAnimationObject, IVisualElement

The CanvasSwapChainPanel type exposes the following members.

Constructors
  NameDescription
Public methodCanvasSwapChainPanel
Initializes a new instance of the CanvasSwapChainPanel class.
Top
Properties
  NameDescription
Public propertySwapChain
Gets or sets the associated swap chain object.
Top
Methods
  NameDescription
Public methodRemoveFromVisualTree
Removes the control from the last FrameworkElement it was parented to.
Top
Remarks

The size of the swap chain may be different from the control's layout size. In particular, it does not stretch to fill the control. For more information on swap chains, see CanvasSwapChain.

When using CanvasSwapChainPanel from managed code, care must be taken to avoid memory leaks due to reference count cycles. See Avoiding memory leaks for more information.

Examples
CanvasSwapChain swapChain = new CanvasSwapChain(new CanvasDevice(), 800, 600);

canvasSwapChainPanel.SwapChain = swapChain;

using(CanvasDrawingSession ds = swapChain.CreateDrawingSession(Colors.White))
{
    ds.DrawCircle(400, 300, 100, Colors.Red, 20);
}

swapChain.Present();
See Also