A Material Design 3.0 Split Button component that combines a primary action with a dropdown menu of additional options.

Members

MemberKindDescription
string TextPropertyGets or sets the text displayed on the primary button.
string SelectedTextPropertyGets the text of the currently selected menu item.
SKColor BackgroundColorPropertyGets or sets the background color of the primary button.
new SKColor TextColorPropertyGets or sets the text color of the primary button.
SKColor DropdownButtonColorPropertyGets or sets the background color of the dropdown button.
SKColor DropdownTextColorPropertyGets or sets the text color of the dropdown button.
float CornerRadiusPropertyGets or sets the corner radius of the split button.
ButtonVariant VariantPropertyGets or sets the button variant (Material Design 3.0).
string LeadingIconPropertyGets or sets the leading icon (SVG path or resource name).
string DropdownIconPropertyGets or sets the dropdown icon.
bool IsDropdownOpenPropertyGets or sets whether the dropdown menu is open.
float SeparatorWidthPropertyGets or sets the width of the separator between the primary and dropdown buttons.
SKColor SeparatorColorPropertyGets or sets the color of the separator between the primary and dropdown buttons.
SplitButtonItem SelectedItemPropertyGets the currently selected menu item.
IReadOnlyList<SplitButtonItem> MenuItemsPropertyGets the collection of menu items.
event EventHandler<EventArgs> PrimaryButtonClickedEventOccurs when the primary button is clicked.
event EventHandler<EventArgs> DropdownButtonClickedEventOccurs when the dropdown button is clicked.
event EventHandler<SplitButtonItemSelectedEventArgs> ItemSelectedEventOccurs when a menu item is selected.
event EventHandler<EventArgs> DropdownStateChangedEventOccurs when the dropdown state changes.
SplitButton()MethodInitializes a new instance of the SplitButton class.
SplitButtonItem AddMenuItem(string text, string icon = null)MethodAdds a menu item to the dropdown. The text for the menu item. The icon for the menu item (optional). The created SplitButtonItem.
bool RemoveMenuItem(SplitButtonItem item)MethodRemoves a menu item from the dropdown. The menu item to remove. True if the item was removed successfully.
void ClearMenuItems()MethodClears all menu items from the dropdown.
void SelectItem(SplitButtonItem item)MethodSelects a menu item. The menu item to select.
void SelectItem(int index)MethodSelects a menu item by index. The index of the menu item to select.
static SplitButton Create(string primaryText, params string[] menuItems)MethodCreates a new SplitButton instance with the specified menu items. The text for the primary button. The menu items for the dropdown. A new SplitButton instance.
static SplitButton CreateFilled(string primaryText, params string[] menuItems)MethodCreates a new SplitButton instance with filled variant. The text for the primary button. The menu items for the dropdown. A new SplitButton instance.
static SplitButton CreateOutlined(string primaryText, params string[] menuItems)MethodCreates a new SplitButton instance with outlined variant. The text for the primary button. The menu items for the dropdown. A new SplitButton instance.

Related