SplitButton
- Assembly:
Fluence.Wpf - Namespace:
Fluence.Wpf.Controls
public class SplitButton : ContentControl, ICommandSource
A button that combines a primary action (Click / Command) on its left half with a secondary "chevron" half that opens a flyout popup containing arbitrary WPF content. The canonical WinUI 3 SplitButton pattern.
Base type: ContentControl (including inherited WPF and .NET members)
Constructors
SplitButton
public SplitButton()
Creates a new SplitButton instance.
Properties
Appearance
public ControlAppearance Appearance { get; set; }
Gets or sets the visual appearance of the split button. Set to Accent to apply the accent-colored variant; the divider stroke will automatically switch to ControlStrokeColorOnAccentSecondaryBrush per WinUI 3 canonical styling.
Command
public ICommand Command { get; set; }
Gets or sets the command to invoke when the primary half is clicked.
CommandParameter
public object CommandParameter { get; set; }
Gets or sets the parameter passed to Command.
CommandTarget
public IInputElement CommandTarget { get; set; }
Gets or sets the element that the command is raised on.
CornerRadius
public CornerRadius CornerRadius { get; set; }
Gets or sets the outer corner radius. Note that the inner halves are split by a 1 px divider; the left half rounds its left corners only and the right half rounds its right corners only using this radius.
DropdownCornerRadius
public CornerRadius DropdownCornerRadius { get; set; }
Gets or sets the corner radius of the flyout popup surface.
Flyout
public object Flyout { get; set; }
Gets or sets the content displayed in the secondary-half flyout popup.
FlyoutTemplate
public DataTemplate FlyoutTemplate { get; set; }
Gets or sets the DataTemplate used to render Flyout.
IsFlyoutOpen
public bool IsFlyoutOpen { get; }
Gets a value indicating whether the secondary-half flyout popup is currently open.
Methods
CloseFlyout
public void CloseFlyout()
Closes the secondary-half flyout popup if it is open. WinUI's SplitButton hosts a FlyoutBase whose Hide() the application calls after handling a click inside arbitrary flyout content (a plain flyout never dismisses itself); this method is the equivalent close affordance for the Flyout object content model, and the light-dismiss (click outside) path is unaffected.
OnApplyTemplate
public override void OnApplyTemplate()
Documentation inherited from the ContentControl API.
OnCreateAutomationPeer
protected override AutomationPeer OnCreateAutomationPeer()
Documentation inherited from the ContentControl API.
OnPrimaryButtonClick
protected virtual void OnPrimaryButtonClick(object sender, RoutedEventArgs e)
Called when the primary half is clicked; raises Click and invokes Command. Override to run logic before the click is raised, calling the base implementation to preserve the click and command behavior.
Parameter sender: The primary button template part that raised the click.
Parameter e: The routed event data from the primary button.
Events
Click
public event RoutedEventHandler Click
Raised when the primary half of the split button is clicked.
Dependency property identifiers
Use these identifiers with WPF property APIs. The matching CLR properties appear above when the control exposes them.
AppearanceProperty
public static readonly DependencyProperty AppearanceProperty
Identifies the Appearance dependency property.
CommandParameterProperty
public static readonly DependencyProperty CommandParameterProperty
Identifies the CommandParameter dependency property.
CommandProperty
public static readonly DependencyProperty CommandProperty
Identifies the Command dependency property.
CommandTargetProperty
public static readonly DependencyProperty CommandTargetProperty
Identifies the CommandTarget dependency property.
CornerRadiusProperty
public static readonly DependencyProperty CornerRadiusProperty
Identifies the CornerRadius dependency property.
DropdownCornerRadiusProperty
public static readonly DependencyProperty DropdownCornerRadiusProperty
Identifies the DropdownCornerRadius dependency property.
FlyoutProperty
public static readonly DependencyProperty FlyoutProperty
Identifies the Flyout dependency property.
FlyoutTemplateProperty
public static readonly DependencyProperty FlyoutTemplateProperty
Identifies the FlyoutTemplate dependency property.
IsFlyoutOpenProperty
public static readonly DependencyProperty IsFlyoutOpenProperty
Identifies the IsFlyoutOpen dependency property.
Fields
ClickEvent
public static readonly RoutedEvent ClickEvent
Identifies the Click routed event.