GalleryBase Class
Represents an abstract base class for a gallery ribbon control.
public abstract class GalleryBase : ItemsControlBase, IKeyTipTarget, ILogicalParent, IVariantControl
- Inheritance:
- object Visual UIElement FrameworkElement Control ItemsControl ItemsControlBase object
- Derived:
- PopupGallery RibbonGallery
- Implements:
- IKeyTipTarget ILogicalParent IVariantControl
Constructors
GalleryBase()
Initializes a new instance of the GalleryBase
class.
protected GalleryBase()
Properties
ActiveItem
Gets the item that is currently active (being previewed).
public object ActiveItem { get; }
Property Value
- object:
The item that is currently active (being previewed).
IsPreviewEnabled
Gets or sets whether preview notifications are enabled for the items.
public bool IsPreviewEnabled { get; set; }
Property Value
- bool:
true
if preview command notifications are enabled for the items; otherwise,false
. The default value isfalse
.
IsSelectionHighlightVisible
Gets or sets whether the SelectedItem's selection highlight is visible for the gallery.
public bool IsSelectionHighlightVisible { get; set; }
Property Value
- bool:
true
if the SelectedItem's selection highlight is visible for the gallery; otherwise,false
. The default value istrue
.
ItemSize
Gets the System.Windows.Size of the items in the gallery.
public Size ItemSize { get; }
Property Value
- Size:
The System.Windows.Size of the items in the gallery.
Remarks
Each item in the gallery must be the same size. This property will automatically be set the first time a gallery measure occurs by examining the size of the first item in the gallery.
SelectedItem
Gets or sets the item that is currently selected.
public object SelectedItem { get; set; }
Property Value
- object:
The item that is currently selected.
ZoomedInItemTemplate
Gets or sets the DataTemplate that is applied to zoomed-in items.
public DataTemplate ZoomedInItemTemplate { get; set; }
Property Value
- DataTemplate:
The DataTemplate that is applied to zoomed-in items.
Remarks
When this property is specified, a zoom-in effect will be made when hovering over items. This template supplies an alternate template for the zoomed-in item that can provide more detail than the normal one.
ZoomedInItemTemplateSelector
Gets or sets the DataTemplateSelector that is used to select a template for zoomed-in items.
public DataTemplateSelector ZoomedInItemTemplateSelector { get; set; }
Property Value
- DataTemplateSelector:
The DataTemplateSelector that is used to select a template for zoomed-in items.
Remarks
When this property is specified, a zoom-in effect will be made when hovering over items. This template selector supplies an alternate template for the zoomed-in item that can provide more detail than the normal one.
Methods
CoerceCommandParameter(DependencyObject, object)
Coerces a new CommandParameterProperty value.
protected override object CoerceCommandParameter(DependencyObject obj, object value)
Parameter | Type | Description |
---|---|---|
obj | DependencyObject | The System.Windows.DependencyObject whose property is changed. |
value | object | The new value being set. |
Returns
- object:
The coerced value to set.
ExtractDataItem(object)
Extracts the data item from the container.
protected virtual object ExtractDataItem(object itemContainer)
Parameter | Type | Description |
---|---|---|
itemContainer | object | The item container. |
Returns
- object:
The data item.
GetContainerForItemOverride()
Creates or identifies the element used to display the specified item.
protected override DependencyObject GetContainerForItemOverride()
Returns
- DependencyObject:
The element that is used to display the given item.
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
.
OnActiveItemChanged(object, object)
Occurs when the ActiveItem property is changed and raises the ActiveItemChanged event.
protected virtual void OnActiveItemChanged(object oldActiveItem, object newActiveItem)
Parameter | Type | Description |
---|---|---|
oldActiveItem | object | The old ActiveItem value. |
newActiveItem | object | The new ActiveItem value. |
OnClick(ExecuteRoutedEventArgs)
Called when the control is clicked.
protected override void OnClick(ExecuteRoutedEventArgs e)
Parameter | Type | Description |
---|---|---|
e | ExecuteRoutedEventArgs | An |
OnItemClick(ObjectItemRoutedEventArgs)
Raises the ItemClick event.
protected virtual void OnItemClick(ObjectItemRoutedEventArgs e)
Parameter | Type | Description |
---|---|---|
e | ObjectItemRoutedEventArgs | An |
OnItemTemplateChanged(DataTemplate, DataTemplate)
Occurs when the ItemTemplate
property has changed.
protected override void OnItemTemplateChanged(DataTemplate oldItemTemplate, DataTemplate newItemTemplate)
Parameter | Type | Description |
---|---|---|
oldItemTemplate | DataTemplate | The old item template. |
newItemTemplate | DataTemplate | The new item template. |
OnMouseLeave(MouseEventArgs)
Invoked when an unhandled Mouse.MouseLeaveEvent attached event is raised on this element. Implement this method to add class handling for this event.
protected override void OnMouseLeave(MouseEventArgs e)
Parameter | Type | Description |
---|---|---|
e | MouseEventArgs | A MouseEventArgs that contains the event data. |
OnSelectedItemChanged(object, object)
Occurs when the SelectedItem property is changed and raises the SelectedItemChanged event.
protected virtual void OnSelectedItemChanged(object oldSelectedItem, object newSelectedItem)
Parameter | Type | Description |
---|---|---|
oldSelectedItem | object | The old SelectedItem value. |
newSelectedItem | object | The new SelectedItem value. |
PrepareContainerForItemOverride(DependencyObject, object)
Prepares the specified element to display the specified item.
protected override void PrepareContainerForItemOverride(DependencyObject element, object item)
Parameter | Type | Description |
---|---|---|
element | DependencyObject | The System.Windows.DependencyObject that is the wrapper element. |
item | object | The item that is being wrapped. |
UpdateCanExecute()
Updates whether the command can execute.
protected override void UpdateCanExecute()
Events
ActiveItemChanged
Occurs when the ActiveItem property is changed.
public event EventHandler<ObjectPropertyChangedRoutedEventArgs> ActiveItemChanged
Event Type
ItemClick
Occurs after a click event occurs on an item in the control.
public event EventHandler<ObjectItemRoutedEventArgs> ItemClick
Event Type
SelectedItemChanged
Occurs when the SelectedItem property is changed.
public event EventHandler<ObjectPropertyChangedRoutedEventArgs> SelectedItemChanged
Event Type
Fields
ActiveItemChangedEvent
Identifies the ActiveItemChanged routed event. This field is read-only.
public static readonly RoutedEvent ActiveItemChangedEvent
ActiveItemProperty
Identifies the ActiveItem dependency property. This field is read-only.
public static readonly DependencyProperty ActiveItemProperty
IsPreviewEnabledProperty
Identifies the IsPreviewEnabled dependency property. This field is read-only.
public static readonly DependencyProperty IsPreviewEnabledProperty
IsSelectionHighlightVisibleProperty
Identifies the IsSelectionHighlightVisible dependency property. This field is read-only.
public static readonly DependencyProperty IsSelectionHighlightVisibleProperty
ItemClickEvent
Identifies the ItemClick routed event. This field is read-only.
public static readonly RoutedEvent ItemClickEvent
ItemSizeProperty
Identifies the ItemSize dependency property. This field is read-only.
public static readonly DependencyProperty ItemSizeProperty
SelectedItemChangedEvent
Identifies the SelectedItemChanged
routed event. This field is read-only.
public static readonly RoutedEvent SelectedItemChangedEvent
SelectedItemProperty
Identifies the SelectedItem dependency property. This field is read-only.
public static readonly DependencyProperty SelectedItemProperty
ZoomedInItemTemplateProperty
Identifies the ZoomedInItemTemplate dependency property. This field is read-only.
public static readonly DependencyProperty ZoomedInItemTemplateProperty
ZoomedInItemTemplateSelectorProperty
Identifies the ZoomedInItemTemplateSelector dependency property. This field is read-only.
public static readonly DependencyProperty ZoomedInItemTemplateSelectorProperty
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.OnCommandChanged(ICommand, ICommand)
- ItemsControlBase.OnContextChanged(ControlContext, ControlContext)
- ItemsControlBase.OnCreateAutomationPeer()
- ItemsControlBase.OnItemsChanged(NotifyCollectionChangedEventArgs)
- ItemsControlBase.OnKeyTipAccessed(string)
- ItemsControlBase.OnPreviewClick(ExecuteRoutedEventArgs)
- ItemsControlBase.OnPropertyChanged(DependencyPropertyChangedEventArgs)
- ItemsControlBase.OnScreenTipClosing(RoutedEventArgs)
- ItemsControlBase.OnScreenTipOpening(RoutedEventArgs)
- ItemsControlBase.OnValidateItems(IList)
- ItemsControlBase.OnVariantSizeChanged(VariantSize, VariantSize)
- ItemsControlBase.RaiseClickEvent(ExecuteRoutedEventArgs)
- 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