Skip to main content

ToggleSplitButton

Description​

Use ToggleSplitButton when the primary half toggles a state and the flyout chooses which variant of that state to apply.

ToggleSplitButton in light mode ToggleSplitButton in dark mode

Open flyout​

ToggleSplitButton with its flyout open in light mode ToggleSplitButton with its flyout open in dark mode

Example usage​

<fluence:ToggleSplitButton Content="Bulleted list" IsChecked="True">
<fluence:ToggleSplitButton.Flyout>
<StackPanel>
<fluence:Button Content="Bulleted list" Command="{Binding BulletedListCommand}" />
<fluence:Button Content="Numbered list" Command="{Binding NumberedListCommand}" />
</StackPanel>
</fluence:ToggleSplitButton.Flyout>
</fluence:ToggleSplitButton>

The main region toggles IsChecked; bind the flyout commands on the page's data context to choose a variant.

var toggle = new Fluence.Wpf.Controls.ToggleSplitButton { Content = "Bulleted list", IsChecked = true };

Key properties​

PropertyDefaultPurpose
IsCheckedfalseCurrent primary-action state.
FlyoutnullChoices shown by the secondary action.
AppearanceStandardSets the visual emphasis.
CommandnullCommand associated with the primary action.

State and behavior​

The main region changes IsChecked; the arrow opens variants without toggling the current state.

Events​

IsCheckedChanged reports a change to IsChecked; Click is raised by the primary action.

Reference​