Language
Edit

ContentSizer Class

Definition

The ContentSizer is a control which can be used to resize any element, usually its parent. If you are using a Microsoft.UI.Xaml.Controls.Grid, use GridSplitter instead.

public class ContentSizer : CommunityToolkit.WinUI.Controls.SizerBase
type ContentSizer = class
    inherit SizerBase
Public Class ContentSizer
Inherits SizerBase
Inheritance
Microsoft.UI.Xaml.Controls.Control
ContentSizer

Constructors

Name Description
ContentSizer()

Fields

Name Description
IsDragInvertedProperty

Identifies the IsDragInverted dependency property.

TargetControlProperty

Identifies the TargetControl dependency property.

Properties

Name Description
Cursor

Gets or sets the cursor to use when hovering over the gripper bar. If left as null, the control will manage the cursor automatically based on the Orientation property value (default).

(Inherited from SizerBase)
DragIncrement

Gets or sets the incremental amount of change for dragging with the mouse or touch of a sizer control. Effectively a snapping increment for changes. The default is 1.

(Inherited from SizerBase)
IsDragInverted

Gets or sets a value indicating whether the ContentSizer control is resizing in the opposite direction.

IsThumbVisible

Gets or sets if the Thumb is visible. If not visible, only the background and cursor will be shown on MouseOver or Pressed states.

(Inherited from SizerBase)
KeyboardIncrement

Gets or sets the distance each press of an arrow key moves a sizer control. The default is 8.

(Inherited from SizerBase)
Orientation

Gets or sets the orientation the sizer will be and how it will interact with other elements. Defaults to Microsoft.UI.Xaml.Controls.Orientation.Vertical.

(Inherited from SizerBase)
TargetControl

Gets or sets the control that the ContentSizer is resizing. Be default, this will be the visual ancestor of the ContentSizer.

Methods

Name Description
OnApplyTemplate() (Inherited from SizerBase)
OnCreateAutomationPeer()

Creates AutomationPeer (Microsoft.UI.Xaml.UIElement.OnCreateAutomationPeer)

(Inherited from SizerBase)
OnDragHorizontal(Double)

Method to process the requested horizontal resize.

OnDragStarting()

Called when the SizerBase control starts to be dragged by the user. Implementer should record current state of manipulated target at this point in time. They will receive the cumulative change in OnDragHorizontal(Double) or OnDragVertical(Double) based on the Orientation property.

OnDragVertical(Double)

Method to process the requested vertical resize.

OnKeyDown(KeyRoutedEventArgs) (Inherited from SizerBase)
OnLoaded(RoutedEventArgs)

Called when the control has been initialized.

OnManipulationDelta(ManipulationDeltaRoutedEventArgs) (Inherited from SizerBase)
OnManipulationStarting(ManipulationStartingRoutedEventArgs) (Inherited from SizerBase)

Applies to