Skip to main content

ToggleSplitButton

C# API / Fluence.Wpf.Controls

  • Assembly: Fluence.Wpf
  • Namespace: Fluence.Wpf.Controls
public class ToggleSplitButton : SplitButton

A SplitButton whose primary half toggles a checked state instead of firing a plain action: clicking it flips IsChecked and then raises Click, while the secondary "chevron" half still opens the flyout. The canonical WinUI 3 ToggleSplitButton pattern, used when the primary half switches a mode on or off and the flyout chooses which variant of that mode applies.

Base type: SplitButton

C# source

Constructors​

ToggleSplitButton​

public ToggleSplitButton()

Creates a new ToggleSplitButton instance.

Properties​

IsChecked​

public bool IsChecked { get; set; }

Gets or sets a value indicating whether the toggle split button is checked. A primary-half click flips this value before Click is raised.

Methods​

OnCreateAutomationPeer​

protected override AutomationPeer OnCreateAutomationPeer()

Documentation inherited from the SplitButton API.

OnPrimaryButtonClick​

protected override void OnPrimaryButtonClick(object sender, RoutedEventArgs e)

Toggles IsChecked and then runs the inherited click behavior, mirroring the WinUI ToggleSplitButton primary-click contract: a Click handler observes the already-flipped state.

Parameter sender: The primary button template part that raised the click.

Parameter e: The routed event data from the primary button.

Events​

IsCheckedChanged​

public event EventHandler<ToggleSplitButtonIsCheckedChangedEventArgs>? IsCheckedChanged

Raised when IsChecked changes, whether from a primary-half click, the Toggle automation pattern, a binding, or a direct property set.

Remarks: Unlike WinUI, the event also fires for values applied before the control is loaded (for example markup-set initial values), matching how the WPF ToggleButton raises its Checked and Unchecked events.

Dependency property identifiers​

Use these identifiers with WPF property APIs. The matching CLR properties appear above when the control exposes them.

IsCheckedProperty​

public static readonly DependencyProperty IsCheckedProperty

Identifies the IsChecked dependency property.