Group Class
Represents a group that appears within a Ribbon control tab.
[TemplatePart(Name = "PART_DialogLauncherButton", Type = typeof(Button))]
[TemplatePart(Name = "PART_Popup", Type = typeof(Popup))]
[TemplatePart(Name = "PART_ResizeGrip", Type = typeof(Thumb))]
public class Group : 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 Group documentation topic.
Constructors
Group()
Initializes an instance of the class.
public Group()
Properties
DialogLauncherKeyTipAccessText
Gets or sets the key tip access text for the group's dialog launcher.
[Localizability(LocalizationCategory.Text)]
public string DialogLauncherKeyTipAccessText { get; set; }
Property Value
- string:
The key tip access text for the group's dialog launcher.
DialogLauncherLabel
Gets the label for the group's dialog launcher.
public string DialogLauncherLabel { get; }
Property Value
- string:
The label for the group's dialog launcher.
Remarks
This property uses the group's ScreenTipHeader if it's a string; otherwise, the Label.
IsCollapsible
Gets or sets whether the group is collapsible.
public bool IsCollapsible { get; set; }
Property Value
- bool:
true
if the group is collapsible; otherwise,false
. The default value istrue
.
IsLabelCollapsible
Gets whether the group label is currently collapsible.
public bool IsLabelCollapsible { get; }
Property Value
- bool:
true
if the group label is currently collapsible; otherwise,false
.
IsPopupOpen
Gets or sets whether a child popup is open.
public bool IsPopupOpen { get; set; }
Property Value
- bool:
true
if the a child popup is open; otherwise,false
.
Variants
The collection of GroupVariant objects for the group that define how and when the group changes variant sizes.
public GroupVariantCollection Variants { get; }
Property Value
- GroupVariantCollection:
The collection of GroupVariant objects for the group that define how and when the group changes variant sizes.
Methods
InvalidateVariants()
Invalidates the variants of the group.
public void InvalidateVariants()
Remarks
Call this method after making changes to the UI of the group or its contained controls to ensure that the cached variant info is updated.
MeasureOverride(Size)
When overridden in a derived class, measures the size in layout required for child elements and determines a size for the FrameworkElement-derived class.
protected override Size MeasureOverride(Size constraint)
Parameter | Type | Description |
---|---|---|
constraint | Size | The available size that this element can give to child elements. Infinity can be specified as a value to indicate that the element will size to whatever content is available. |
Returns
- Size:
The size that this element determines it needs during layout, based on its calculations of child element sizes.
OnApplyTemplate()
Invoked whenever application code or internal processes call ApplyTemplate().
public override void OnApplyTemplate()
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. |
OnKeyTipAccessed(string)
Called when key tip access text for the control is typed by the end user.
protected override bool OnKeyTipAccessed(string keyTipAccessText)
Parameter | Type | Description |
---|---|---|
keyTipAccessText | string | The key tip access text that was typed. |
Returns
- bool:
true
if an action was executed that should stop key tip mode; otherwise,false
.
Remarks
Implementations of this method should either execute the action associated with the control or move focus to the control so that the end user can take further action such as in a menu.
OnMouseLeftButtonDown(MouseButtonEventArgs)
Invoked when an unhandled MouseLeftButtonDown routed event is raised on this element. Implement this method to add class handling for this event.
protected override void OnMouseLeftButtonDown(MouseButtonEventArgs e)
Parameter | Type | Description |
---|---|---|
e | MouseButtonEventArgs | The event data for the MouseLeftButtonDown event. |
OnPopupClosed()
Raises the PopupClosedEvent.
protected virtual void OnPopupClosed()
OnPopupOpened()
Raises the PopupOpenedEvent.
protected virtual void OnPopupOpened()
OnPopupOpening()
Raises the PopupOpeningEvent.
protected virtual bool OnPopupOpening()
Returns
- bool:
true
if the popup opening should be allowed to open; otherwise,false
.
OnPreviewMouseLeftButtonDown(MouseButtonEventArgs)
Invoked when an unhandled PreviewMouseLeftButtonDown routed event is raised on this element. Implement this method to add class handling for this event.
protected override void OnPreviewMouseLeftButtonDown(MouseButtonEventArgs e)
Parameter | Type | Description |
---|---|---|
e | MouseButtonEventArgs | The event data for the MouseLeftButtonDown event. |
OnPreviewMouseLeftButtonUp(MouseButtonEventArgs)
Invoked when an unhandled PreviewMouseLeftButtonUp routed event is raised on this element. Implement this method to add class handling for this event.
protected override void OnPreviewMouseLeftButtonUp(MouseButtonEventArgs e)
Parameter | Type | Description |
---|---|---|
e | MouseButtonEventArgs | The event data for the PreviewMouseLeftButtonUp event. |
OnPropertyChanged(DependencyPropertyChangedEventArgs)
Occurs when a property is changed.
protected override void OnPropertyChanged(DependencyPropertyChangedEventArgs e)
Parameter | Type | Description |
---|---|---|
e | DependencyPropertyChangedEventArgs | A System.Windows.DependencyPropertyChangedEventArgs that contains the event data. |
Events
PopupClosed
Occurs when the value of the IsPopupOpen property changes from true
to false
.
PopupOpened
Occurs when the value of the IsPopupOpen property changes from false
to true
.
PopupOpening
Occurs before the value of the IsPopupOpen property changes from false
to true
.
public event EventHandler<CancelRoutedEventArgs> PopupOpening
Event Type
Fields
DialogLauncherKeyTipAccessTextProperty
Identifies the DialogLauncherKeyTipAccessText dependency property. This field is read-only.
public static readonly DependencyProperty DialogLauncherKeyTipAccessTextProperty
DialogLauncherLabelProperty
Identifies the DialogLauncherLabel dependency property. This field is read-only.
public static readonly DependencyProperty DialogLauncherLabelProperty
IsCollapsibleProperty
Identifies the IsCollapsible dependency property. This field is read-only.
public static readonly DependencyProperty IsCollapsibleProperty
IsLabelCollapsibleProperty
Identifies the IsLabelCollapsible dependency property. This field is read-only.
public static readonly DependencyProperty IsLabelCollapsibleProperty
IsPopupOpenProperty
Identifies the IsPopupOpen dependency property. This field is read-only.
public static readonly DependencyProperty IsPopupOpenProperty
PopupClosedEvent
Identifies the PopupClosed routed event. This field is read-only.
public static readonly RoutedEvent PopupClosedEvent
PopupOpenedEvent
Identifies the PopupOpened routed event. This field is read-only.
public static readonly RoutedEvent PopupOpenedEvent
PopupOpeningEvent
Identifies the PopupOpening routed event. This field is read-only.
public static readonly RoutedEvent PopupOpeningEvent
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.OnContextChanged(ControlContext, ControlContext)
- ItemsControlBase.OnPreviewClick(ExecuteRoutedEventArgs)
- ItemsControlBase.OnScreenTipClosing(RoutedEventArgs)
- ItemsControlBase.OnScreenTipOpening(RoutedEventArgs)
- ItemsControlBase.OnValidateItems(IList)
- 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