In This Article

ButtonGroup Class

Represents a button group control.

public class ButtonGroup : ItemsControlBase, IKeyTipTarget, ILogicalParent, IVariantControl
Inheritance:
object Visual UIElement FrameworkElement Control ItemsControl ItemsControlBase object
Implements:
IKeyTipTarget ILogicalParent IVariantControl

Remarks

For detailed documentation on this control's features and how to use them, please see the ButtonGroup documentation topic.

Constructors

ButtonGroup()

Initializes an instance of the class.

public ButtonGroup()

Properties

AllowSeparator

Gets or sets whether the group is capable of displaying a separator.

public bool AllowSeparator { get; set; }

Property Value

bool:

true if the group is capable of displaying a separator; otherwise, false. The default value is true.

HasBorder

Gets or sets whether the group should display a border.

public bool HasBorder { get; set; }

Property Value

bool:

true if the group should display a border; otherwise, false. The default value is true.

HasSeparator

Gets or sets whether the group should display a separator.

public bool HasSeparator { get; set; }

Property Value

bool:

true if the group should display a separator; otherwise, false. The default value is false.

ItemVariantSize

Gets a VariantSize that specifies the variant size of contained controls based on the panel's current VariantSize.

public VariantSize ItemVariantSize { get; }

Property Value

VariantSize:

A VariantSize that specifies the variant size of contained controls based on the panel's current VariantSize.

Methods

GetContainerForItemOverride()

Creates or identifies the element used to display a specified item.

protected override DependencyObject GetContainerForItemOverride()

Returns

DependencyObject:

A GalleryItem.

IsItemItsOwnContainerOverride(object)

Determines if the specified item is (or is eligible to be) its own item container.

protected override bool IsItemItsOwnContainerOverride(object item)
Parameter Type Description
item object

Specified item.

Returns

bool:

true if the item is its own item container; otherwise, false.

OnContextChanged(ControlContext, ControlContext)

Occurs when the Context property is changed.

protected override void OnContextChanged(ControlContext oldContext, ControlContext newContext)
Parameter Type Description
oldContext ControlContext

The old ControlContext value.

newContext ControlContext

The new ControlContext value.

OnCreateAutomationPeer()

Creates and returns an AutomationPeer object for this type.

protected override AutomationPeer OnCreateAutomationPeer()

Returns

AutomationPeer:

The AutomationPeer that was created.

OnItemsChanged(NotifyCollectionChangedEventArgs)

Invoked when the Items property changes.

protected override void OnItemsChanged(NotifyCollectionChangedEventArgs e)
Parameter Type Description
e NotifyCollectionChangedEventArgs

A NotifyCollectionChangedEventArgs that contains the event data.

OnRender(DrawingContext)

When overridden in a derived class, participates in rendering operations that are directed by the layout system. The rendering instructions for this element are not used directly when this method is invoked, and are instead preserved for later asynchronous use by layout and drawing.

protected override void OnRender(DrawingContext drawingContext)
Parameter Type Description
drawingContext DrawingContext

The drawing instructions for a specific element. This context is provided to the layout system.

OnValidateItems(IList)

Invoked when the specified IList of items needs to be validated for inclusion in this ItemsControl.

protected override void OnValidateItems(IList items)
Parameter Type Description
items IList

The IList of items to validate.

Fields

AllowSeparatorProperty

Identifies the AllowSeparator dependency property. This field is read-only.

public static readonly DependencyProperty AllowSeparatorProperty

HasBorderProperty

Identifies the HasBorder dependency property. This field is read-only.

public static readonly DependencyProperty HasBorderProperty

HasSeparatorProperty

Identifies the HasSeparator dependency property. This field is read-only.

public static readonly DependencyProperty HasSeparatorProperty

ItemVariantSizeProperty

Identifies the ItemVariantSize dependency property. This field is read-only.

public static readonly DependencyProperty ItemVariantSizeProperty

Inherited Members