Class Splitter
Splitter class.
Inheritance
Namespace: Syncfusion.Windows.Tools.Controls
Assembly: Syncfusion.Tools.Wpf.dll
Syntax
public class Splitter : UserControl
Remarks
When you start resizing, you can see horizontal or vertical line appear when dragging any side of the dock window. This line is splitter. You can override style or template of the Splitter.
Examples
This example shows how to override the style of the Splitter in XAML.
<Style x:Key="SplitterBaseStyle" TargetType="{x:Type Syncfusion:Splitter}">
<Setter Property="MinWidth" Value="{Binding Path=SplitterSize
, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Syncfusion:DockingManager}}}"/>
<Setter Property="MinHeight" Value="{Binding Path=SplitterSize
, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Syncfusion:DockingManager}}}"/>
<Setter Property="Margin" Value="0"/>
<Setter Property="Background" Value="{Binding Path=SplitterBackground
, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Syncfusion:DockingManager}}}" />
<Setter Property="Cursor" Value="SizeNS"/>
<Setter Property="AdornerTemplate" Value="{StaticResource SplitterAdornerTemplate}"/>
<Setter Property="Template" Value="{StaticResource SplitterTemplate}"/>
</Style>
Constructors
Splitter()
Initializes a new instance of the Splitter class.
Declaration
public Splitter()
Splitter(Orientation)
Initializes a new instance of the Splitter class.
Declaration
public Splitter(Orientation orientation)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Controls.Orientation | orientation | The orientation. |
Fields
AdornerTemplateProperty
Dependency property used to specify adorner's template.
Declaration
public static readonly DependencyProperty AdornerTemplateProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
DockingManagerProperty
Identifies the DockingManager dependency property. This enables animation, styling, binding, etc...
Declaration
public static readonly DependencyProperty DockingManagerProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
OffsetProperty
Identifies the Offset Dependency Property.
Declaration
public static readonly DependencyProperty OffsetProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
OrientationProperty
Dependency property used to specify splitter's orientation.
Declaration
public static readonly DependencyProperty OrientationProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
UseNativeFloatWindowProperty
Declaration
public static readonly DependencyProperty UseNativeFloatWindowProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
Properties
AdornerTemplate
Gets or sets adorner template used to show adorner.
Declaration
public ControlTemplate AdornerTemplate { get; set; }
Property Value
Type |
---|
System.Windows.Controls.ControlTemplate |
Examples
This example shows how to write ControlTemplate for Splitter in XAML.
<ControlTemplate x:Key="SplitterAdornerTemplate">
<StackPanel x:Name="stPanel" Orientation="Horizontal">
<Border MinWidth="4" MinHeight="4" >
<Border.Background>
<SolidColorBrush Color="Gray" Opacity="0.6" />
</Border.Background>
</Border>
</StackPanel>
<ControlTemplate.Triggers>
<Trigger Property="Syncfusion:SplitterAdorner.Orientation" Value="Horizontal">
<Setter TargetName="stPanel" Property="LayoutTransform">
<Setter.Value>
<RotateTransform Angle="-90"/>
</Setter.Value>
</Setter>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
This example shows how to use AdornerTemplate property in XAML.
<Style x:Key="SplitterBaseStyle" TargetType="{x:Type Syncfusion:Splitter}">
<Setter Property="AdornerTemplate" Value="{StaticResource SplitterAdornerTemplate}"/>
</Style>
See Also
CheckOffset
Gets a value indicating whether this instance is checkoffset
Declaration
public bool CheckOffset { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
DockingManager
Gets or sets the DockingManager
Declaration
public DockingManager DockingManager { get; }
Property Value
Type |
---|
DockingManager |
Offset
Gets or sets the value of the Offset dependency property.
Declaration
public double Offset { get; protected set; }
Property Value
Type |
---|
System.Double |
Orientation
Gets or sets splitter orientation.
Declaration
public Orientation Orientation { get; set; }
Property Value
Type |
---|
System.Windows.Controls.Orientation |
Examples
To set Orientation property please see AdornerTemplate property example.
UseNativeFloatWindow
Gets or sets the UseNativeFloatWindow property
Declaration
public bool UseNativeFloatWindow { get; }
Property Value
Type |
---|
System.Boolean |
Methods
CreateSplitterAdorner()
Creates adorner used to display splitter moving.
Declaration
protected virtual SplitterAdorner CreateSplitterAdorner()
Returns
Type | Description |
---|---|
SplitterAdorner | return splitter adorner. |
MeasureOverride(Size)
Called to remeasure a control.
Declaration
protected override Size MeasureOverride(Size constraint)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Size | constraint | The maximum size that the method can return. |
Returns
Type | Description |
---|---|
System.Windows.Size | The size of the control, up to the maximum specified by |
OnIsPressedChanged(Boolean)
Processes IsPressed dependency property changes.
Declaration
protected virtual void OnIsPressedChanged(bool newValue)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | newValue | New value of the dependency property. |
OnKeyDown(KeyEventArgs)
Processes Escape key.
Declaration
protected override void OnKeyDown(KeyEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Input.KeyEventArgs | e | The instance containing the event data. |
OnLostMouseCapture(MouseEventArgs)
Declaration
protected override void OnLostMouseCapture(MouseEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Input.MouseEventArgs | e |
OnMaxOffsetLeftChanged(DependencyPropertyChangedEventArgs)
Raises MaxOffsetLeftChanged event.
Declaration
protected virtual void OnMaxOffsetLeftChanged(DependencyPropertyChangedEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.DependencyPropertyChangedEventArgs | e | Property changes details, such as old value and new value. |
OnMaxOffsetRightChanged(DependencyPropertyChangedEventArgs)
Raises MaxOffsetRightChanged event.
Declaration
protected virtual void OnMaxOffsetRightChanged(DependencyPropertyChangedEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.DependencyPropertyChangedEventArgs | e | Property changes details, such as old value and new value. |
OnMouseLeftButtonDown(MouseButtonEventArgs)
Processes left mouse button press.
Declaration
protected override void OnMouseLeftButtonDown(MouseButtonEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Input.MouseButtonEventArgs | e | The instance containing the event data. |
OnMouseLeftButtonUp(MouseButtonEventArgs)
Processes left mouse button release.
Declaration
protected override void OnMouseLeftButtonUp(MouseButtonEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Input.MouseButtonEventArgs | e | The instance containing the event data. |
OnMouseMove(MouseEventArgs)
Processes mouse move.
Declaration
protected override void OnMouseMove(MouseEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Input.MouseEventArgs | e | The instance containing the event data. |
OnOffsetChanged(DependencyPropertyChangedEventArgs)
Updates property value cache and raises OffsetChanged event.
Declaration
protected virtual void OnOffsetChanged(DependencyPropertyChangedEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.DependencyPropertyChangedEventArgs | e | Property changes details, such as old value and new value. |
OnOffsetStepChanged(DependencyPropertyChangedEventArgs)
Raises OffsetStepChanged event.
Declaration
protected virtual void OnOffsetStepChanged(DependencyPropertyChangedEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.DependencyPropertyChangedEventArgs | e | Property changes details, such as old value and new value. |
OnOrientationChanged()
Updates cursor depending on the splitter orientation.
Declaration
protected virtual void OnOrientationChanged()
OnPropertyChanged(DependencyPropertyChangedEventArgs)
Invoked whenever the effective value of any dependency property on this System.Windows.FrameworkElement has been updated. The specific dependency property that changed is reported in the arguments parameter. Overrides System.Windows.DependencyObject.OnPropertyChanged(System.Windows.DependencyPropertyChangedEventArgs).
Declaration
protected override void OnPropertyChanged(DependencyPropertyChangedEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.DependencyPropertyChangedEventArgs | e | The event data that describes the property that changed, as well as old and new values. |
OnStylusSystemGesture(StylusSystemGestureEventArgs)
Declaration
protected override void OnStylusSystemGesture(StylusSystemGestureEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Input.StylusSystemGestureEventArgs | e |
Events
IsPressedChanged
Event that occurs when splitter's pressed state changes.
Declaration
public event EventHandler IsPressedChanged
Event Type
Type |
---|
System.EventHandler |
MaxOffsetLeftChanged
Event that is raised when MaxOffsetLeft property is changed.
Declaration
public event PropertyChangedCallback MaxOffsetLeftChanged
Event Type
Type |
---|
System.Windows.PropertyChangedCallback |
MaxOffsetRightChanged
Event that is raised when MaxOffsetRight property is changed.
Declaration
public event PropertyChangedCallback MaxOffsetRightChanged
Event Type
Type |
---|
System.Windows.PropertyChangedCallback |
OffsetChanged
Event that is raised when user releases mouse button after moving scroll bar.
Declaration
public event PropertyChangedCallback OffsetChanged
Event Type
Type |
---|
System.Windows.PropertyChangedCallback |
OffsetChanging
Event that is raised when Offset property is changed.
Declaration
public event PropertyChangedCallback OffsetChanging
Event Type
Type |
---|
System.Windows.PropertyChangedCallback |
OffsetStepChanged
Event that is raised when OffsetStep property is changed.
Declaration
public event PropertyChangedCallback OffsetStepChanged
Event Type
Type |
---|
System.Windows.PropertyChangedCallback |