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 istrue
.
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 istrue
.
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 isfalse
.
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
- ItemsControlBase.ClickEvent
- ItemsControlBase.PreviewClickEvent
- ItemsControlBase.ScreenTipClosingEvent
- ItemsControlBase.ScreenTipOpeningEvent
- ItemsControlBase.CommandProperty
- ItemsControlBase.CommandParameterProperty
- ItemsControlBase.CommandTargetProperty
- ItemsControlBase.ContextProperty
- ItemsControlBase.HasImageProperty
- ItemsControlBase.HasLabelProperty
- ItemsControlBase.IdProperty
- ItemsControlBase.ImageSourceLargeProperty
- ItemsControlBase.ImageSourceSmallProperty
- ItemsControlBase.IsHighlightedProperty
- ItemsControlBase.KeyTipAccessTextProperty
- ItemsControlBase.LabelProperty
- ItemsControlBase.ScreenTipDescriptionProperty
- ItemsControlBase.ScreenTipFooterProperty
- ItemsControlBase.ScreenTipHeaderProperty
- ItemsControlBase.ScreenTipHelpUriProperty
- ItemsControlBase.ScreenTipImageSourceProperty
- ItemsControlBase.VariantSizeProperty
- ItemsControlBase.CoerceCommandParameter(DependencyObject, object)
- ItemsControlBase.OnClick(ExecuteRoutedEventArgs)
- ItemsControlBase.OnCommandChanged(ICommand, ICommand)
- ItemsControlBase.OnKeyTipAccessed(string)
- ItemsControlBase.OnPreviewClick(ExecuteRoutedEventArgs)
- ItemsControlBase.OnPropertyChanged(DependencyPropertyChangedEventArgs)
- ItemsControlBase.OnScreenTipClosing(RoutedEventArgs)
- ItemsControlBase.OnScreenTipOpening(RoutedEventArgs)
- ItemsControlBase.OnVariantSizeChanged(VariantSize, VariantSize)
- ItemsControlBase.RaiseClickEvent(ExecuteRoutedEventArgs)
- ItemsControlBase.UpdateCanExecute()
- ItemsControlBase.CanUpdateCanExecuteWhenHidden
- ItemsControlBase.Command
- ItemsControlBase.CommandParameter
- ItemsControlBase.CommandTarget
- ItemsControlBase.Context
- ItemsControlBase.HasImage
- ItemsControlBase.HasLabel
- ItemsControlBase.Id
- ItemsControlBase.ImageSourceLarge
- ItemsControlBase.ImageSourceSmall
- ItemsControlBase.IsHighlighted
- ItemsControlBase.KeyTipAccessText
- ItemsControlBase.Label
- ItemsControlBase.ScreenTipDescription
- ItemsControlBase.ScreenTipFooter
- ItemsControlBase.ScreenTipHeader
- ItemsControlBase.ScreenTipHelpUri
- ItemsControlBase.ScreenTipImageSource
- ItemsControlBase.VariantSize
- ItemsControlBase.Click
- ItemsControlBase.PreviewClick
- ItemsControlBase.ScreenTipClosing
- ItemsControlBase.ScreenTipOpening