BarGalleryBase Class
Represents an abstract base class for a gallery control.
public abstract class BarGalleryBase : Selector, DUCE.IResource, IAnimatable, IFrameworkInputElement, IInputElement, ISupportInitialize, IHaveResources, IQueryAmbient, IAddChild, IGeneratorHost, IContainItemStorage, ICommandSource, ISupportsCoerceLabel
- Inheritance:
- System.Object System.Windows.Threading.DispatcherObject System.Windows.DependencyObject System.Windows.Media.Visual System.Windows.UIElement System.Windows.FrameworkElement System.Windows.Controls.Control System.Windows.Controls.ItemsControl System.Windows.Controls.Primitives.Selector Object
- Derived:
- BarMenuGallery BarMenuGalleryHostBase
Constructors
BarGalleryBase()
Initializes a new instance of the BarGalleryBase class.
protected BarGalleryBase()
Properties
BetweenPreviewDelay
Gets or sets the delay in milliseconds between PreviewedItem updates as a new item is highlighted.
public int BetweenPreviewDelay { get; set; }
Property Value
- System.Int32:
The delay in milliseconds between PreviewedItem updates as a new item is highlighted. The default value is
0
.
CanCloneToRibbonQuickAccessToolBar
Gets or sets whether the control can be cloned to the ribbon quick-access toolbar.
public bool CanCloneToRibbonQuickAccessToolBar { get; set; }
Property Value
- System.Boolean:
true
if the control can be cloned to the ribbon quick-access toolbar; otherwise,false
. The default value istrue
.
CanStopPreviewingOnMouseLeave
Gets whether the gallery can stop previewing when the mouse leaves the control.
protected virtual bool CanStopPreviewingOnMouseLeave { get; }
Property Value
- System.Boolean:
true
if the gallery can stop previewing when the mouse leaves the control; otherwise,false
.
Command
Gets or sets the System.Windows.Input.ICommand to execute when a gallery item is selected.
public ICommand Command { get; set; }
Property Value
- System.Windows.Input.ICommand:
The System.Windows.Input.ICommand to execute when a gallery item is selected.
CommandTarget
Gets or sets the System.Windows.IInputElement target for the Command.
public IInputElement CommandTarget { get; set; }
Property Value
- System.Windows.IInputElement:
The System.Windows.IInputElement target for the Command.
HighlightedItem
Gets the item that is currently highlighted.
public object HighlightedItem { get; }
Property Value
- System.Object:
The item that is currently highlighted.
InitialPreviewDelay
Gets or sets the delay in milliseconds for preview mode to begin after an item is highlighted.
public int InitialPreviewDelay { get; set; }
Property Value
- System.Int32:
The delay in milliseconds for preview mode to begin after an item is highlighted. The default value is
300
.
IsSelectionSupported
Gets or sets whether selection is supported.
public bool IsSelectionSupported { get; set; }
Property Value
- System.Boolean:
true
if selection is supported; otherwise,false
. The default value istrue
.
ItemSpacing
Gets or sets the amount of spacing between items.
public double ItemSpacing { get; set; }
Property Value
- System.Double:
The amount of spacing between items. The default value is
0
.
Key
Gets or sets a string that uniquely identifies the control.
[Localizability(LocalizationCategory.NeverLocalize)]
public string Key { get; set; }
Property Value
- System.String:
A string that uniquely identifies the control.
Label
Gets or sets the text label to display.
[Localizability(LocalizationCategory.Label)]
public string Label { get; set; }
Property Value
- System.String:
The text label to display.
LargeImageSource
Gets or sets the System.Windows.Media.ImageSource for a large image, generally 32x32
size.
public ImageSource LargeImageSource { get; set; }
Property Value
- System.Windows.Media.ImageSource:
The System.Windows.Media.ImageSource for a large image.
MediumImageSource
Gets or sets the System.Windows.Media.ImageSource for a medium image, generally 24x24
size.
public ImageSource MediumImageSource { get; set; }
Property Value
- System.Windows.Media.ImageSource:
The System.Windows.Media.ImageSource for a medium image.
MinItemHeight
Gets or sets the minimum item height.
public double MinItemHeight { get; set; }
Property Value
- System.Double:
The minimum item height. The default value is
16.0
.
MinItemWidth
Gets or sets the minimum item width.
public double MinItemWidth { get; set; }
Property Value
- System.Double:
The minimum item width. The default value is
16.0
.
PreviewedItem
Gets the item that is currently being previewed.
public object PreviewedItem { get; }
Property Value
- System.Object:
The item that is currently being previewed.
SmallImageSource
Gets or sets the System.Windows.Media.ImageSource for a small image, generally 16x16
size.
public ImageSource SmallImageSource { get; set; }
Property Value
- System.Windows.Media.ImageSource:
The System.Windows.Media.ImageSource for a small image.
Title
Gets or sets the string title, which can override the Label when displayed in screen tips and customization UI.
[Localizability(LocalizationCategory.Title)]
public string Title { get; set; }
Property Value
- System.String:
The string title.
UseAccentedItemBorder
Gets or sets whether to use an accented item border for gallery items, common when they have vibrant content such as color swatches.
public bool UseAccentedItemBorder { get; set; }
Property Value
- System.Boolean:
true
if an accented item border should be used for gallery items; otherwise,false
. The default value isfalse
.
UserInterfaceDensity
Gets or sets a UserInterfaceDensity that indicates how compact or spacious the UI should appear.
public UserInterfaceDensity UserInterfaceDensity { get; set; }
Property Value
- UserInterfaceDensity:
A UserInterfaceDensity that indicates how compact or spacious the UI should appear. The default value is Compact.
Methods
ClearContainerForItemOverride(DependencyObject, Object)
Returns an item container to the state it was in before System.Windows.Controls.ItemsControl.PrepareContainerForItemOverride(System.Windows.DependencyObject, System.Object).
protected override void ClearContainerForItemOverride(DependencyObject element, object item)
Parameter | Type | Description |
---|---|---|
element | System.Windows.DependencyObject | The item container element. |
item | System.Object | The data item. |
GetContainerForItemOverride()
Creates or identifies the element that is used to display the given item.
protected override DependencyObject GetContainerForItemOverride()
Returns
- System.Windows.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 container.
protected override bool IsItemItsOwnContainerOverride(object item)
Parameter | Type | Description |
---|---|---|
item | System.Object | The item to check. |
Returns
- System.Boolean:
true if the item is (or is eligible to be) its own container; otherwise, false.
OnHighlightedItemChanged(RoutedEventArgs)
Occurs after the HighlightedItem property has changed.
protected virtual void OnHighlightedItemChanged(RoutedEventArgs e)
Parameter | Type | Description |
---|---|---|
e | System.Windows.RoutedEventArgs | The System.Windows.RoutedEventArgs that contains the event data. |
OnIsKeyboardFocusWithinChanged(DependencyPropertyChangedEventArgs)
Called when the IsKeyboardFocusWithin property has changed.
protected override void OnIsKeyboardFocusWithinChanged(DependencyPropertyChangedEventArgs e)
Parameter | Type | Description |
---|---|---|
e | System.Windows.DependencyPropertyChangedEventArgs | The event data. |
OnItemSpacingPropertyValueChanged(DependencyPropertyChangedEventArgs)
Occurs when the ItemSpacing property value changes.
protected virtual void OnItemSpacingPropertyValueChanged(DependencyPropertyChangedEventArgs e)
Parameter | Type | Description |
---|---|---|
e | System.Windows.DependencyPropertyChangedEventArgs | The System.Windows.DependencyPropertyChangedEventArgs containing data related to this event. |
OnMinItemHeightPropertyValueChanged(DependencyPropertyChangedEventArgs)
Occurs when the MinItemHeight property value changes.
protected virtual void OnMinItemHeightPropertyValueChanged(DependencyPropertyChangedEventArgs e)
Parameter | Type | Description |
---|---|---|
e | System.Windows.DependencyPropertyChangedEventArgs | The System.Windows.DependencyPropertyChangedEventArgs containing data related to this event. |
OnMinItemWidthPropertyValueChanged(DependencyPropertyChangedEventArgs)
Occurs when the MinItemWidth property value changes.
protected virtual void OnMinItemWidthPropertyValueChanged(DependencyPropertyChangedEventArgs e)
Parameter | Type | Description |
---|---|---|
e | System.Windows.DependencyPropertyChangedEventArgs | The System.Windows.DependencyPropertyChangedEventArgs containing data related to this event. |
OnMouseLeave(MouseEventArgs)
Invoked when an unhandled MouseLeave 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 | System.Windows.Input.MouseEventArgs | The System.Windows.Input.MouseEventArgs that contains the event data. |
OnMouseMove(MouseEventArgs)
Invoked when an unhandled MouseMove attached event reaches an element in its route that is derived from this class. Implement this method to add class handling for this event.
protected override void OnMouseMove(MouseEventArgs e)
Parameter | Type | Description |
---|---|---|
e | System.Windows.Input.MouseEventArgs | The System.Windows.Input.MouseEventArgs that contains the event data. |
OnSelectionChanged(SelectionChangedEventArgs)
Called when the selection changes.
protected override void OnSelectionChanged(SelectionChangedEventArgs e)
Parameter | Type | Description |
---|---|---|
e | System.Windows.Controls.SelectionChangedEventArgs | The event data. |
OnUserInterfaceDensityPropertyValueChanged(DependencyPropertyChangedEventArgs)
Occurs when the UserInterfaceDensity property value changes.
protected virtual void OnUserInterfaceDensityPropertyValueChanged(DependencyPropertyChangedEventArgs e)
Parameter | Type | Description |
---|---|---|
e | System.Windows.DependencyPropertyChangedEventArgs | The System.Windows.DependencyPropertyChangedEventArgs containing data related to this event. |
PrepareContainerForItemOverride(DependencyObject, Object)
Prepares the specified element to display the specified item.
protected override void PrepareContainerForItemOverride(DependencyObject element, object item)
Parameter | Type | Description |
---|---|---|
element | System.Windows.DependencyObject | The element that is used to display the specified item. |
item | System.Object | The specified item to display. |
ScrollToSelectedItem(Boolean)
Scrolls the gallery to the selected item.
public void ScrollToSelectedItem(bool canFocus)
Parameter | Type | Description |
---|---|---|
canFocus | System.Boolean | Whether to also focus the selected gallery item. |
ToString()
Provides a string representation of the System.Windows.Controls.ItemsControl object.
public override string ToString()
Returns
- System.String:
The string representation of the object.
Events
HighlightedItemChanged
Occurs after the HighlightedItem property has changed.
public event RoutedEventHandler HighlightedItemChanged
Event Type
- System.Windows.RoutedEventHandler
Fields
BetweenPreviewDelayProperty
Identifies the BetweenPreviewDelay dependency property. This field is read-only.
public static readonly DependencyProperty BetweenPreviewDelayProperty
CanCloneToRibbonQuickAccessToolBarProperty
Identifies the CanCloneToRibbonQuickAccessToolBar dependency property. This field is read-only.
public static readonly DependencyProperty CanCloneToRibbonQuickAccessToolBarProperty
CommandProperty
Identifies the Command dependency property. This field is read-only.
public static readonly DependencyProperty CommandProperty
CommandTargetProperty
Identifies the CommandTarget dependency property. This field is read-only.
public static readonly DependencyProperty CommandTargetProperty
HighlightedItemChangedEvent
Identifies the HighlightedItemChanged routed event. This field is read-only.
public static readonly RoutedEvent HighlightedItemChangedEvent
HighlightedItemProperty
Identifies the HighlightedItem dependency property. This field is read-only.
public static readonly DependencyProperty HighlightedItemProperty
InitialPreviewDelayProperty
Identifies the InitialPreviewDelay dependency property. This field is read-only.
public static readonly DependencyProperty InitialPreviewDelayProperty
IsSelectionSupportedProperty
Identifies the IsSelectionSupported dependency property. This field is read-only.
public static readonly DependencyProperty IsSelectionSupportedProperty
ItemSpacingProperty
Identifies the ItemSpacing dependency property. This field is read-only.
public static readonly DependencyProperty ItemSpacingProperty
KeyProperty
Identifies the Key dependency property. This field is read-only.
public static readonly DependencyProperty KeyProperty
LabelProperty
Identifies the Label dependency property. This field is read-only.
public static readonly DependencyProperty LabelProperty
LargeImageSourceProperty
Identifies the LargeImageSource dependency property. This field is read-only.
public static readonly DependencyProperty LargeImageSourceProperty
MediumImageSourceProperty
Identifies the MediumImageSource dependency property. This field is read-only.
public static readonly DependencyProperty MediumImageSourceProperty
MinItemHeightProperty
Identifies the MinItemHeight dependency property. This field is read-only.
public static readonly DependencyProperty MinItemHeightProperty
MinItemWidthProperty
Identifies the MinItemWidth dependency property. This field is read-only.
public static readonly DependencyProperty MinItemWidthProperty
PreviewedItemProperty
Identifies the PreviewedItem dependency property. This field is read-only.
public static readonly DependencyProperty PreviewedItemProperty
SmallImageSourceProperty
Identifies the SmallImageSource dependency property. This field is read-only.
public static readonly DependencyProperty SmallImageSourceProperty
TitleProperty
Identifies the Title dependency property. This field is read-only.
public static readonly DependencyProperty TitleProperty
UseAccentedItemBorderProperty
Identifies the UseAccentedItemBorder dependency property. This field is read-only.
public static readonly DependencyProperty UseAccentedItemBorderProperty
UserInterfaceDensityProperty
Identifies the UserInterfaceDensity dependency property. This field is read-only.
public static readonly DependencyProperty UserInterfaceDensityProperty
Inherited Members
- System.Object.Equals(System.Object)
- System.Object.Equals(System.Object, System.Object)
- System.Object.ReferenceEquals(System.Object, System.Object)
- System.Object.GetHashCode()
- System.Object.GetType()
- System.Object.MemberwiseClone()
Extension Methods
- FrameworkElementExtensions.AnimateDoubleProperty(String, Double, Double, Double, Nullable<Double>, Nullable<Double>)
- FrameworkElementExtensions.BindToProperty(DependencyProperty, Object, String, BindingMode, IValueConverter, Object)
- FrameworkElementExtensions.BindToProperty(DependencyProperty, Object, DependencyProperty, BindingMode, IValueConverter, Object)
- FrameworkElementExtensions.GetCurrentSize()