HypernovaDesktop Components · docs
Binarymission
WPF › Smart Navigator › BinarySmartListBox

BinarySmartListBox

class.NET 6 / 8 / 10.NET Framework 4.8Binarymission.WPF.Controls.ListControls

A custom ListBox class that provides a customized and enhanced items navigation experience.

public class BinarySmartListBox : ListBox

Inherits from / implements: ListBox

Remarks

The control is used like a ListBox: add items, usually BinarySmartListBoxItems, or set ItemsSource. How this control works. The template has no items presenter of its own. It shows the items in an inner list ( PART_ChildListBox ) whose items are this control's Items and whose SelectedIndex is bound two-way to this control's, inside a scroll viewer with hidden scroll bars ( PART_ChildScrollViewer ). The previous and next buttons, the arrow keys along NavigationOrientation, Home, End and the mouse wheel all move the selection one item at a time, and the selected item is then brought into view - so the list scrolls by following the selection, not by counting pixels. Keys are taken before the inner list sees them. The inner list would move its own selection on an arrow key, which is this control's through the binding, and a handler further up would then move it again: one key press, two items. The buttons follow the selection and the item count , recomputed whenever either changes; the tool tip on a disabled button says why it is disabled. Animations let go when they finish (Stop), so the animated panel goes back to sizing itself instead of keeping the size it had when the animation started.

Members at a glance

BinarySmartListBoxInitializes a new instance of the BinarySmartListBox class.
ControlAnimationTypeGets or sets the type of the control animation.
ItemEllipseBorderBrushHoverGets or sets the item ellipse border brush on hover.
ItemEllipseBorderBrushNormalGets or sets the item ellipse border brush normal.
ItemEllipseBorderBrushSelectedGets or sets the item ellipse border brush on selected.
ItemEllipseFillHoverGets or sets the item ellipse fill hover brush.
ItemEllipseFillNormalGets or sets the item ellipse fill normal brush.
ItemEllipseFillSelectedGets or sets the item ellipse fill selected brush.
ItemTitleBackgroundGets or sets the item title background brush,
ItemTitleForegroundGets or sets the item title foreground brush.
NavigationButtonArrowFillGets or sets the navigation button arrow fill brush.
NavigationButtonDisabledArrowFillGets or sets the navigation button disabled arrow fill brush.
NavigationButtonDisabledBackgroundGets or sets the navigation button disabled background brush.
NavigationButtonDisabledBorderGets or sets the navigation button disabled border brush.
NavigationButtonDisabledBorderBrushForStrokeLayerGets or sets the navigation button disabled border brush for stroke layer.
NavigationButtonDropShadowColorGets or sets the color of the navigation button drop shadow.
NavigationButtonDropShadowEffectGets the effect the navigation buttons draw their drop shadow with.
NavigationButtonDropShadowSoftnessGets or sets how far the navigation button's drop shadow spreads, in device-independent pixels.
NavigationButtonHasDropShadowGets or sets a value indicating whether the navigation button has drop shadow rendered.
NavigationButtonHoverBackgroundGets or sets the navigation button hover background brush.
NavigationButtonHoverBorderGets or sets the navigation button hover border brush.
NavigationButtonHoverBorderBrushForStrokeLayerGets or sets the navigation button hover border brush for stroke layer.
NavigationButtonNormalBackgroundGets or sets the navigation button normal background brush.
NavigationButtonNormalBorderGets or sets the navigation button normal border brush.
NavigationButtonNormalBorderBrushForStrokeLayerGets or sets the navigation button normal border brush for stroke layer.
NavigationButtonPressedBackgroundGets or sets the navigation button pressed background brush.
NavigationButtonPressedBorderGets or sets the navigation button pressed border brush.
NavigationButtonPressedBorderBrushForStrokeLayerGets or sets the navigation button pressed border brush for stroke layer.
NavigationOrientationGets or sets the navigation orientation.
OnApplyTemplateWhen overridden in a derived class, is invoked whenever application code or internal processes call ApplyTemplate.
OnItemsChangedKeeps the navigation buttons right as items are added and removed.
OnPreviewKeyDownMoves the selection with the arrow keys along the list's orientation, and to the first or last item with Home and End.
OnPreviewMouseWheelMoves to the next item as the mouse wheel turns towards the user, and to the previous one as it turns away.
OnRenderSizeChangedCalled when the rendered size of the list changes, which is where the navigator recalculates how many items fit.
OnSelectionChangedRaises the SelectionChanged event. BinarySmartListBox overrides it so the control's own handling runs alongside the base behavior.
ControlAnimationTypePropertyIdentifies the ControlAnimationType dependency property.
ItemEllipseBorderBrushHoverPropertyIdentifies the ItemEllipseBorderBrushHover dependency property.
ItemEllipseBorderBrushNormalPropertyIdentifies the ItemEllipseBorderBrushNormal dependency property.
ItemEllipseBorderBrushSelectedPropertyIdentifies the ItemEllipseBorderBrushSelected dependency property.
ItemEllipseFillHoverPropertyIdentifies the ItemEllipseFillHover dependency property.
ItemEllipseFillNormalPropertyIdentifies the ItemEllipseFillNormal dependency property.
ItemEllipseFillSelectedPropertyIdentifies the ItemEllipseFillSelected dependency property.
ItemTitleBackgroundPropertyIdentifies the ItemTitleBackground dependency property.
ItemTitleForegroundPropertyIdentifies the ItemTitleForeground dependency property.
NavigationButtonArrowFillPropertyIdentifies the NavigationButtonArrowFill dependency property.
NavigationButtonDisabledArrowFillPropertyIdentifies the NavigationButtonDisabledArrowFill dependency property.
NavigationButtonDisabledBackgroundPropertyIdentifies the NavigationButtonDisabledBackground dependency property.
NavigationButtonDisabledBorderBrushForStrokeLayerPropertyIdentifies the NavigationButtonDisabledBorderBrushForStrokeLayer dependency property.
NavigationButtonDisabledBorderPropertyIdentifies the NavigationButtonDisabledBorder dependency property.
NavigationButtonDropShadowColorPropertyIdentifies the NavigationButtonDropShadowColor dependency property.
NavigationButtonDropShadowEffectPropertyIdentifies the NavigationButtonDropShadowEffect dependency property.
NavigationButtonDropShadowSoftnessPropertyIdentifies the NavigationButtonDropShadowSoftness dependency property.
NavigationButtonHasDropShadowPropertyIdentifies the NavigationButtonHasDropShadow dependency property.
NavigationButtonHoverBackgroundPropertyIdentifies the NavigationButtonHoverBackground dependency property.
NavigationButtonHoverBorderBrushForStrokeLayerPropertyIdentifies the NavigationButtonHoverBorderBrushForStrokeLayer dependency property.
NavigationButtonHoverBorderPropertyIdentifies the NavigationButtonHoverBorder dependency property.
NavigationButtonNormalBackgroundPropertyIdentifies the NavigationButtonNormalBackground dependency property.
NavigationButtonNormalBorderBrushForStrokeLayerPropertyIdentifies the NavigationButtonNormalBorderBrushForStrokeLayer dependency property.
NavigationButtonNormalBorderPropertyIdentifies the NavigationButtonNormalBorder dependency property.
NavigationButtonPressedBackgroundPropertyIdentifies the NavigationButtonPressedBackground dependency property.
NavigationButtonPressedBorderBrushForStrokeLayerPropertyIdentifies the NavigationButtonPressedBorderBrushForStrokeLayer dependency property.
NavigationButtonPressedBorderPropertyIdentifies the NavigationButtonPressedBorder dependency property.
NavigationOrientationPropertyIdentifies the NavigationOrientation dependency property.

Constructors

BinarySmartListBox

public BinarySmartListBox() : base()

Initializes a new instance of the BinarySmartListBox class.

Properties

ControlAnimationType

public ControlItemAnimationType ControlAnimationType

Gets or sets the type of the control animation.

Value. The type of the control animation.

ItemEllipseBorderBrushHover

public Brush ItemEllipseBorderBrushHover

Gets or sets the item ellipse border brush on hover.

ItemEllipseBorderBrushNormal

public Brush ItemEllipseBorderBrushNormal

Gets or sets the item ellipse border brush normal.

ItemEllipseBorderBrushSelected

public Brush ItemEllipseBorderBrushSelected

Gets or sets the item ellipse border brush on selected.

ItemEllipseFillHover

public Brush ItemEllipseFillHover

Gets or sets the item ellipse fill hover brush.

ItemEllipseFillNormal

public Brush ItemEllipseFillNormal

Gets or sets the item ellipse fill normal brush.

ItemEllipseFillSelected

public Brush ItemEllipseFillSelected

Gets or sets the item ellipse fill selected brush.

ItemTitleBackground

public Brush ItemTitleBackground

Gets or sets the item title background brush,

ItemTitleForeground

public Brush ItemTitleForeground

Gets or sets the item title foreground brush.

NavigationButtonArrowFill

public Brush NavigationButtonArrowFill

Gets or sets the navigation button arrow fill brush.

NavigationButtonDisabledArrowFill

public Brush NavigationButtonDisabledArrowFill

Gets or sets the navigation button disabled arrow fill brush.

NavigationButtonDisabledBackground

public Brush NavigationButtonDisabledBackground

Gets or sets the navigation button disabled background brush.

NavigationButtonDisabledBorder

public Brush NavigationButtonDisabledBorder

Gets or sets the navigation button disabled border brush.

NavigationButtonDisabledBorderBrushForStrokeLayer

public Brush NavigationButtonDisabledBorderBrushForStrokeLayer

Gets or sets the navigation button disabled border brush for stroke layer.

NavigationButtonDropShadowColor

public Color NavigationButtonDropShadowColor

Gets or sets the color of the navigation button drop shadow.

Value. The color of the navigation button drop shadow.

NavigationButtonDropShadowEffect

public Effect NavigationButtonDropShadowEffect

Gets the effect the navigation buttons draw their drop shadow with.

Value. A frozen DropShadowEffect built from NavigationButtonDropShadowColor and NavigationButtonDropShadowSoftness, and rebuilt whenever either changes.

The control applies this to its PART_PreviousListButton and PART_NextListButton buttons while NavigationButtonHasDropShadow is true, and removes it when that is false.

NavigationButtonDropShadowSoftness

public double NavigationButtonDropShadowSoftness

Gets or sets how far the navigation button's drop shadow spreads, in device-independent pixels.

Value. The blur radius of the shadow. The theme sets 6.

Despite the name, this is the DropShadowEffect blur radius in pixels, not a 0 to 1 softness. It takes effect only when NavigationButtonHasDropShadow is true.

NavigationButtonHasDropShadow

public bool NavigationButtonHasDropShadow

Gets or sets a value indicating whether the navigation button has drop shadow rendered.

Value. true if [navigation button has drop shadow]; otherwise, false .

NavigationButtonHoverBackground

public Brush NavigationButtonHoverBackground

Gets or sets the navigation button hover background brush.

NavigationButtonHoverBorder

public Brush NavigationButtonHoverBorder

Gets or sets the navigation button hover border brush.

NavigationButtonHoverBorderBrushForStrokeLayer

public Brush NavigationButtonHoverBorderBrushForStrokeLayer

Gets or sets the navigation button hover border brush for stroke layer.

NavigationButtonNormalBackground

public Brush NavigationButtonNormalBackground

Gets or sets the navigation button normal background brush.

NavigationButtonNormalBorder

public Brush NavigationButtonNormalBorder

Gets or sets the navigation button normal border brush.

NavigationButtonNormalBorderBrushForStrokeLayer

public Brush NavigationButtonNormalBorderBrushForStrokeLayer

Gets or sets the navigation button normal border brush for stroke layer.

Value. The navigation button normal border brush for stroke layer.

NavigationButtonPressedBackground

public Brush NavigationButtonPressedBackground

Gets or sets the navigation button pressed background brush.

NavigationButtonPressedBorder

public Brush NavigationButtonPressedBorder

Gets or sets the navigation button pressed border brush.

NavigationButtonPressedBorderBrushForStrokeLayer

public Brush NavigationButtonPressedBorderBrushForStrokeLayer

Gets or sets the navigation button pressed border brush for stroke layer.

NavigationOrientation

public NavigationOrientationIs NavigationOrientation

Gets or sets the navigation orientation.

Value. The navigation orientation.

Methods

OnApplyTemplate

public override void OnApplyTemplate()

When overridden in a derived class, is invoked whenever application code or internal processes call ApplyTemplate.

OnItemsChanged

protected override void OnItemsChanged(NotifyCollectionChangedEventArgs e)

Keeps the navigation buttons right as items are added and removed.

e
The change.

OnPreviewKeyDown

protected override void OnPreviewKeyDown(KeyEventArgs e)

Moves the selection with the arrow keys along the list's orientation, and to the first or last item with Home and End.

e
The key.

OnPreviewMouseWheel

protected override void OnPreviewMouseWheel(MouseWheelEventArgs e)

Moves to the next item as the mouse wheel turns towards the user, and to the previous one as it turns away.

e
The wheel.

OnRenderSizeChanged

protected override void OnRenderSizeChanged(SizeChangedInfo sizeInfo)

Called when the rendered size of the list changes, which is where the navigator recalculates how many items fit.

sizeInfo
The size change.

OnSelectionChanged

protected override void OnSelectionChanged(SelectionChangedEventArgs e)

Raises the SelectionChanged event. BinarySmartListBox overrides it so the control's own handling runs alongside the base behavior.

e
The event data.

Fields

ControlAnimationTypeProperty

public static readonly DependencyProperty ControlAnimationTypeProperty

Identifies the ControlAnimationType dependency property.

ItemEllipseBorderBrushHoverProperty

public static readonly DependencyProperty ItemEllipseBorderBrushHoverProperty

Identifies the ItemEllipseBorderBrushHover dependency property.

ItemEllipseBorderBrushNormalProperty

public static readonly DependencyProperty ItemEllipseBorderBrushNormalProperty

Identifies the ItemEllipseBorderBrushNormal dependency property.

ItemEllipseBorderBrushSelectedProperty

public static readonly DependencyProperty ItemEllipseBorderBrushSelectedProperty

Identifies the ItemEllipseBorderBrushSelected dependency property.

ItemEllipseFillHoverProperty

public static readonly DependencyProperty ItemEllipseFillHoverProperty

Identifies the ItemEllipseFillHover dependency property.

ItemEllipseFillNormalProperty

public static readonly DependencyProperty ItemEllipseFillNormalProperty

Identifies the ItemEllipseFillNormal dependency property.

ItemEllipseFillSelectedProperty

public static readonly DependencyProperty ItemEllipseFillSelectedProperty

Identifies the ItemEllipseFillSelected dependency property.

ItemTitleBackgroundProperty

public static readonly DependencyProperty ItemTitleBackgroundProperty

Identifies the ItemTitleBackground dependency property.

ItemTitleForegroundProperty

public static readonly DependencyProperty ItemTitleForegroundProperty

Identifies the ItemTitleForeground dependency property.

NavigationButtonArrowFillProperty

public static readonly DependencyProperty NavigationButtonArrowFillProperty

Identifies the NavigationButtonArrowFill dependency property.

NavigationButtonDisabledArrowFillProperty

public static readonly DependencyProperty NavigationButtonDisabledArrowFillProperty

Identifies the NavigationButtonDisabledArrowFill dependency property.

NavigationButtonDisabledBackgroundProperty

public static readonly DependencyProperty NavigationButtonDisabledBackgroundProperty

Identifies the NavigationButtonDisabledBackground dependency property.

NavigationButtonDisabledBorderBrushForStrokeLayerProperty

public static readonly DependencyProperty NavigationButtonDisabledBorderBrushForStrokeLayerProperty

Identifies the NavigationButtonDisabledBorderBrushForStrokeLayer dependency property.

NavigationButtonDisabledBorderProperty

public static readonly DependencyProperty NavigationButtonDisabledBorderProperty

Identifies the NavigationButtonDisabledBorder dependency property.

NavigationButtonDropShadowColorProperty

public static readonly DependencyProperty NavigationButtonDropShadowColorProperty

Identifies the NavigationButtonDropShadowColor dependency property.

NavigationButtonDropShadowEffectProperty

public static readonly DependencyProperty NavigationButtonDropShadowEffectProperty

Identifies the NavigationButtonDropShadowEffect dependency property.

NavigationButtonDropShadowSoftnessProperty

public static readonly DependencyProperty NavigationButtonDropShadowSoftnessProperty

Identifies the NavigationButtonDropShadowSoftness dependency property.

NavigationButtonHasDropShadowProperty

public static readonly DependencyProperty NavigationButtonHasDropShadowProperty

Identifies the NavigationButtonHasDropShadow dependency property.

NavigationButtonHoverBackgroundProperty

public static readonly DependencyProperty NavigationButtonHoverBackgroundProperty

Identifies the NavigationButtonHoverBackground dependency property.

NavigationButtonHoverBorderBrushForStrokeLayerProperty

public static readonly DependencyProperty NavigationButtonHoverBorderBrushForStrokeLayerProperty

Identifies the NavigationButtonHoverBorderBrushForStrokeLayer dependency property.

NavigationButtonHoverBorderProperty

public static readonly DependencyProperty NavigationButtonHoverBorderProperty

Identifies the NavigationButtonHoverBorder dependency property.

NavigationButtonNormalBackgroundProperty

public static readonly DependencyProperty NavigationButtonNormalBackgroundProperty

Identifies the NavigationButtonNormalBackground dependency property.

NavigationButtonNormalBorderBrushForStrokeLayerProperty

public static readonly DependencyProperty NavigationButtonNormalBorderBrushForStrokeLayerProperty

Identifies the NavigationButtonNormalBorderBrushForStrokeLayer dependency property.

NavigationButtonNormalBorderProperty

public static readonly DependencyProperty NavigationButtonNormalBorderProperty

Identifies the NavigationButtonNormalBorder dependency property.

NavigationButtonPressedBackgroundProperty

public static readonly DependencyProperty NavigationButtonPressedBackgroundProperty

Identifies the NavigationButtonPressedBackground dependency property.

NavigationButtonPressedBorderBrushForStrokeLayerProperty

public static readonly DependencyProperty NavigationButtonPressedBorderBrushForStrokeLayerProperty

Identifies the NavigationButtonPressedBorderBrushForStrokeLayer dependency property.

NavigationButtonPressedBorderProperty

public static readonly DependencyProperty NavigationButtonPressedBorderProperty

Identifies the NavigationButtonPressedBorder dependency property.

NavigationOrientationProperty

public static readonly DependencyProperty NavigationOrientationProperty

Identifies the NavigationOrientation dependency property.