Language
Edit

SizerBase Class

Definition

Base class for splitting/resizing type controls like GridSplitter and ContentSizer. Acts similar to an enlarged Microsoft.UI.Xaml.Controls.Primitives.Thumb type control, but with keyboard support. Subclasses should override the various abstract methods here to implement their behavior.

[Microsoft.UI.Xaml.TemplateVisualState(GroupName="CommonStates", Name="Normal")]
[Microsoft.UI.Xaml.TemplateVisualState(GroupName="CommonStates", Name="PointerOver")]
[Microsoft.UI.Xaml.TemplateVisualState(GroupName="CommonStates", Name="Pressed")]
[Microsoft.UI.Xaml.TemplateVisualState(GroupName="CommonStates", Name="Disabled")]
[Microsoft.UI.Xaml.TemplateVisualState(GroupName="OrientationStates", Name="Horizontal")]
[Microsoft.UI.Xaml.TemplateVisualState(GroupName="OrientationStates", Name="Vertical")]
[Microsoft.UI.Xaml.TemplateVisualState(GroupName="ThumbVisibilityStates", Name="Visible")]
[Microsoft.UI.Xaml.TemplateVisualState(GroupName="ThumbVisibilityStates", Name="Collapsed")]
public abstract class SizerBase : Microsoft.UI.Xaml.Controls.Control
[<Microsoft.UI.Xaml.TemplateVisualState(GroupName="CommonStates", Name="Normal")>]
[<Microsoft.UI.Xaml.TemplateVisualState(GroupName="CommonStates", Name="PointerOver")>]
[<Microsoft.UI.Xaml.TemplateVisualState(GroupName="CommonStates", Name="Pressed")>]
[<Microsoft.UI.Xaml.TemplateVisualState(GroupName="CommonStates", Name="Disabled")>]
[<Microsoft.UI.Xaml.TemplateVisualState(GroupName="OrientationStates", Name="Horizontal")>]
[<Microsoft.UI.Xaml.TemplateVisualState(GroupName="OrientationStates", Name="Vertical")>]
[<Microsoft.UI.Xaml.TemplateVisualState(GroupName="ThumbVisibilityStates", Name="Visible")>]
[<Microsoft.UI.Xaml.TemplateVisualState(GroupName="ThumbVisibilityStates", Name="Collapsed")>]
type SizerBase = class
    inherit Control
Public MustInherit Class SizerBase
Inherits Control
Inheritance
Microsoft.UI.Xaml.Controls.Control
SizerBase
Derived
Attributes
Microsoft.UI.Xaml.TemplateVisualStateAttribute

Constructors

Name Description
SizerBase()

Initializes a new instance of the SizerBase class.

Fields

Name Description
CursorProperty

Identifies the Cursor dependency property.

DragIncrementProperty

Identifies the DragIncrement dependency property.

IsThumbVisibleProperty

Identifies the IsThumbVisible dependency property.

KeyboardIncrementProperty

Identifies the KeyboardIncrement dependency property.

OrientationProperty

Identifies the Orientation 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).

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.

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.

KeyboardIncrement

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

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.

Methods

Name Description
IsValidHeight(FrameworkElement, Double, Double)

Check for new requested vertical size is valid or not

IsValidWidth(FrameworkElement, Double, Double)

Check for new requested horizontal size is valid or not

OnApplyTemplate() Microsoft.UI.Xaml.Controls.Control.OnApplyTemplate
OnCreateAutomationPeer()

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

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) Microsoft.UI.Xaml.Controls.Control.OnKeyDown(Microsoft.UI.Xaml.Input.KeyRoutedEventArgs)
OnLoaded(RoutedEventArgs)

Called when the control has been initialized.

OnManipulationDelta(ManipulationDeltaRoutedEventArgs) Microsoft.UI.Xaml.Controls.Control.OnManipulationDelta(Microsoft.UI.Xaml.Input.ManipulationDeltaRoutedEventArgs)
OnManipulationStarting(ManipulationStartingRoutedEventArgs) Microsoft.UI.Xaml.Controls.Control.OnManipulationStarting(Microsoft.UI.Xaml.Input.ManipulationStartingRoutedEventArgs)

Applies to