HypernovaDesktop Components · docs
Binarymission
WPF › Smart Navigator › BinarySmartListBoxItem

BinarySmartListBoxItem

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

A card in a BinarySmartListBox: a rounded box holding a picture, a bold title and a line or two of text – or any content of your own.

public class BinarySmartListBoxItem : ListBoxItem

Inherits from / implements: ListBoxItem

Remarks

A card with an ItemTitle shows ItemImage at its left, the title, and BodyContent beneath it, each with its own font and colour properties. A card whose ItemTitle is null or empty shows its ContentControl.Content instead.

The card is drawn as a border (ItemBorderBrush, ItemBorderBackgroundBrush, ItemBorderThickness, ItemBorderCornerRadius) set in by ItemBorderMargin and padded by ItemBorderPadding. It casts a soft shadow under the pointer, and the selected card takes the selection colours of BinarySmartListResources. The look comes from the list's ItemsControl.ItemContainerStyle, so a card is drawn this way only inside a BinarySmartListBox that keeps its built-in item style.

Examples

using System;
using System.Windows.Media.Imaging;
using Binarymission.WPF.Controls.ListControls;

recentReports.Items.Add(new BinarySmartListBoxItem
{
    ItemTitle = "Cash flow forecast",
    BodyContent = "Next 13 weeks, by bank account.",
    BodyContentMaximumWidthForOneLine = 220,
    ItemImage = new BitmapImage(new Uri("pack://application:,,,/Images/Forecast.png")),
    Tag = "cash-13w"
});

Members at a glance

Properties
BodyContentGets or sets the text under the card's title – a description, a date, a summary.
BodyContentFontFamilyGets or sets the typeface of the text under the card's title.
BodyContentFontSizeGets or sets the size of the text under the card's title.
BodyContentFontStretchGets or sets how condensed or expanded the text under the card's title is drawn, where the typeface offers it.
BodyContentFontStyleGets or sets whether the text under the card's title is upright or italic.
BodyContentFontWeightGets or sets how heavy the text under the card's title is drawn.
BodyContentMarginGets or sets the space around the text under the card's title.
BodyContentMaximumWidthForOneLineGets or sets the width of the text under the card's title; longer text wraps onto further lines.
ItemBodyContentBrushGets or sets the colour of the text under the card's title.
ItemBorderBackgroundBrushGets or sets the fill of the card.
ItemBorderBrushGets or sets the colour of the card's outline.
ItemBorderCornerRadiusGets or sets how rounded the card's corners are.
ItemBorderMarginGets or sets the space around the card, separating it from its neighbours.
ItemBorderPaddingGets or sets the space between the card's outline and its contents.
ItemBorderThicknessGets or sets the width of the card's outline.
ItemImageGets or sets the picture at the left of the card – an icon, a thumbnail or a photo.
ItemTitleGets or sets the card's title, shown in bold at the top of the card.
ItemTitleBrushGets or sets the colour of the card's title.
ItemTitleFontFamilyGets or sets the typeface of the card's title.
ItemTitleFontSizeGets or sets the size of the card's title text.
ItemTitleFontStretchGets or sets how condensed or expanded the card's title is drawn, where the typeface offers it.
ItemTitleFontStyleGets or sets whether the card's title is upright or italic.
ItemTitleFontWeightGets or sets how heavy the card's title is drawn.
ItemTitleTextMarginGets or sets the space around the card's title.
Fields
BodyContentFontFamilyPropertyIdentifies the BodyContentFontFamily dependency property.
BodyContentFontSizePropertyIdentifies the BodyContentFontSize dependency property.
BodyContentFontStretchPropertyIdentifies the BodyContentFontStretch dependency property.
BodyContentFontStylePropertyIdentifies the BodyContentFontStyle dependency property.
BodyContentFontWeightPropertyIdentifies the BodyContentFontWeight dependency property.
BodyContentMarginPropertyIdentifies the BodyContentMargin dependency property.
BodyContentMaximumWidthForOneLinePropertyIdentifies the BodyContentMaximumWidthForOneLine dependency property.
BodyContentPropertyIdentifies the BodyContent dependency property.
ItemBodyContentBrushPropertyIdentifies the ItemBodyContentBrush dependency property.
ItemBorderBackgroundBrushPropertyIdentifies the ItemBorderBackgroundBrush dependency property.
ItemBorderBrushPropertyIdentifies the ItemBorderBrush dependency property.
ItemBorderCornerRadiusPropertyIdentifies the ItemBorderCornerRadius dependency property.
ItemBorderMarginPropertyIdentifies the ItemBorderMargin dependency property.
ItemBorderPaddingPropertyIdentifies the ItemBorderPadding dependency property.
ItemBorderThicknessPropertyIdentifies the ItemBorderThickness dependency property.
ItemImagePropertyIdentifies the ItemImage dependency property.
ItemTitleBrushPropertyIdentifies the ItemTitleBrush dependency property.
ItemTitleFontFamilyPropertyIdentifies the ItemTitleFontFamily dependency property.
ItemTitleFontSizePropertyIdentifies the ItemTitleFontSize dependency property.
ItemTitleFontStretchPropertyIdentifies the ItemTitleFontStretch dependency property.
ItemTitleFontStylePropertyIdentifies the ItemTitleFontStyle dependency property.
ItemTitleFontWeightPropertyIdentifies the ItemTitleFontWeight dependency property.
ItemTitlePropertyIdentifies the ItemTitle dependency property.
ItemTitleTextMarginPropertyIdentifies the ItemTitleTextMargin dependency property.

Properties

BodyContent

public string BodyContent

Gets or sets the text under the card's title – a description, a date, a summary.

Value
The text, wrapped to BodyContentMaximumWidthForOneLine when that is set. The default is an empty string.
Remarks

Shown only on a card with an ItemTitle.

BodyContentFontFamily

public FontFamily BodyContentFontFamily

Gets or sets the typeface of the text under the card's title.

Value
The default is null, which gives the text no typeface of its own.

BodyContentFontSize

public double BodyContentFontSize

Gets or sets the size of the text under the card's title.

Value
The size in logical pixels (1/96 inch); the default is 12.

BodyContentFontStretch

public FontStretch BodyContentFontStretch

Gets or sets how condensed or expanded the text under the card's title is drawn, where the typeface offers it.

Value
The default is Normal.

BodyContentFontStyle

public FontStyle BodyContentFontStyle

Gets or sets whether the text under the card's title is upright or italic.

Value
The default is Normal.

BodyContentFontWeight

public FontWeight BodyContentFontWeight

Gets or sets how heavy the text under the card's title is drawn.

Value
The default is Normal.

BodyContentMargin

public Thickness BodyContentMargin

Gets or sets the space around the text under the card's title.

Value
The margin in logical pixels (1/96 inch); the default is 10 on the left, 5 on the right and none above or below.

BodyContentMaximumWidthForOneLine

public double BodyContentMaximumWidthForOneLine

Gets or sets the width of the text under the card's title; longer text wraps onto further lines.

Value
The width in logical pixels (1/96 inch). The default, NaN, sizes the text to its length on one line; set a width – 200 to 260 suits most cards – to wrap it.
Remarks

A width that is set is fixed, not a maximum: the text block is this wide however short its text, and so it sets the width of the card.

Example
<nav:BinarySmartListBoxItem ItemTitle="Stock levels"
                            BodyContent="Lines below their reorder point, by warehouse."
                            BodyContentMaximumWidthForOneLine="240" />

ItemBodyContentBrush

public Brush ItemBodyContentBrush

Gets or sets the colour of the text under the card's title.

Value
The default with no skin in force is the system window text colour (WindowTextBrush); a Binarymission skin gives it its secondary text colour.

ItemBorderBackgroundBrush

public Brush ItemBorderBackgroundBrush

Gets or sets the fill of the card.

Value
The default with no skin in force is LightCyan; a Binarymission skin supplies its own. The selected card is filled with the selection colour instead (BinarySmartListResources.ItemSelectionBackgroundBrush).

ItemBorderBrush

public Brush ItemBorderBrush

Gets or sets the colour of the card's outline.

Value
The default with no skin in force is DarkCyan; a Binarymission skin supplies its own. The selected card is outlined in the selection colour instead.
See also

ItemBorderCornerRadius

public CornerRadius ItemBorderCornerRadius

Gets or sets how rounded the card's corners are.

Value
The radius in logical pixels (1/96 inch); the default is 4 at every corner. 0 gives square corners.

ItemBorderMargin

public Thickness ItemBorderMargin

Gets or sets the space around the card, separating it from its neighbours.

Value
The margin in logical pixels (1/96 inch); the default is 2 on the left, 6 above, 3 on the right and 6 below.

ItemBorderPadding

public Thickness ItemBorderPadding

Gets or sets the space between the card's outline and its contents.

Value
The padding in logical pixels (1/96 inch); the default is 8 on every side.

ItemBorderThickness

public double ItemBorderThickness

Gets or sets the width of the card's outline.

Value
The width in logical pixels (1/96 inch), the same on every side; the default is 1. 0 draws no outline.

ItemImage

public ImageSource ItemImage

Gets or sets the picture at the left of the card – an icon, a thumbnail or a photo.

Value
The picture, shown at its own size beside the title and body text. The default is null: no picture.
Remarks

Shown only on a card with an ItemTitle. In XAML a path or pack URI can be given directly: ItemImage="/Images/Chart.png".

ItemTitle

public string ItemTitle

Gets or sets the card's title, shown in bold at the top of the card.

Value
The title, on one line. The default is an empty string.
Remarks

While the title is null or empty the card shows its ContentControl.Content instead of the picture, title and body text; give it a title to use them.

ItemTitleBrush

public Brush ItemTitleBrush

Gets or sets the colour of the card's title.

Value
The default with no skin in force is the system window text colour (WindowTextBrush); a Binarymission skin supplies its own.

ItemTitleFontFamily

public FontFamily ItemTitleFontFamily

Gets or sets the typeface of the card's title.

Value
The default is null, which gives the title no typeface of its own.

ItemTitleFontSize

public double ItemTitleFontSize

Gets or sets the size of the card's title text.

Value
The size in logical pixels (1/96 inch); the default is 14.

ItemTitleFontStretch

public FontStretch ItemTitleFontStretch

Gets or sets how condensed or expanded the card's title is drawn, where the typeface offers it.

Value
The default is Normal.

ItemTitleFontStyle

public FontStyle ItemTitleFontStyle

Gets or sets whether the card's title is upright or italic.

Value
The default is Normal.

ItemTitleFontWeight

public FontWeight ItemTitleFontWeight

Gets or sets how heavy the card's title is drawn.

Value
The default is Normal; SemiBold or Bold makes the title stand out from the body text.

ItemTitleTextMargin

public Thickness ItemTitleTextMargin

Gets or sets the space around the card's title.

Value
The margin in logical pixels (1/96 inch); the default is 10 on the left, 5 on the right and none above or below. The title sits a further 10 in from the picture and 5 above the body text, whatever this margin is.

Fields

BodyContentFontFamilyProperty static

public static readonly DependencyProperty BodyContentFontFamilyProperty

Identifies the BodyContentFontFamily dependency property.

BodyContentFontSizeProperty static

public static readonly DependencyProperty BodyContentFontSizeProperty

Identifies the BodyContentFontSize dependency property.

BodyContentFontStretchProperty static

public static readonly DependencyProperty BodyContentFontStretchProperty

Identifies the BodyContentFontStretch dependency property.

BodyContentFontStyleProperty static

public static readonly DependencyProperty BodyContentFontStyleProperty

Identifies the BodyContentFontStyle dependency property.

BodyContentFontWeightProperty static

public static readonly DependencyProperty BodyContentFontWeightProperty

Identifies the BodyContentFontWeight dependency property.

BodyContentMarginProperty static

public static readonly DependencyProperty BodyContentMarginProperty

Identifies the BodyContentMargin dependency property.

BodyContentMaximumWidthForOneLineProperty static

public static readonly DependencyProperty BodyContentMaximumWidthForOneLineProperty

Identifies the BodyContentMaximumWidthForOneLine dependency property.

BodyContentProperty static

public static readonly DependencyProperty BodyContentProperty

Identifies the BodyContent dependency property.

ItemBodyContentBrushProperty static

public static readonly DependencyProperty ItemBodyContentBrushProperty

Identifies the ItemBodyContentBrush dependency property.

ItemBorderBackgroundBrushProperty static

public static readonly DependencyProperty ItemBorderBackgroundBrushProperty

Identifies the ItemBorderBackgroundBrush dependency property.

ItemBorderBrushProperty static

public static readonly DependencyProperty ItemBorderBrushProperty

Identifies the ItemBorderBrush dependency property.

ItemBorderCornerRadiusProperty static

public static readonly DependencyProperty ItemBorderCornerRadiusProperty

Identifies the ItemBorderCornerRadius dependency property.

ItemBorderMarginProperty static

public static readonly DependencyProperty ItemBorderMarginProperty

Identifies the ItemBorderMargin dependency property.

ItemBorderPaddingProperty static

public static readonly DependencyProperty ItemBorderPaddingProperty

Identifies the ItemBorderPadding dependency property.

ItemBorderThicknessProperty static

public static readonly DependencyProperty ItemBorderThicknessProperty

Identifies the ItemBorderThickness dependency property.

ItemImageProperty static

public static readonly DependencyProperty ItemImageProperty

Identifies the ItemImage dependency property.

ItemTitleBrushProperty static

public static readonly DependencyProperty ItemTitleBrushProperty

Identifies the ItemTitleBrush dependency property.

ItemTitleFontFamilyProperty static

public static readonly DependencyProperty ItemTitleFontFamilyProperty

Identifies the ItemTitleFontFamily dependency property.

ItemTitleFontSizeProperty static

public static readonly DependencyProperty ItemTitleFontSizeProperty

Identifies the ItemTitleFontSize dependency property.

ItemTitleFontStretchProperty static

public static readonly DependencyProperty ItemTitleFontStretchProperty

Identifies the ItemTitleFontStretch dependency property.

ItemTitleFontStyleProperty static

public static readonly DependencyProperty ItemTitleFontStyleProperty

Identifies the ItemTitleFontStyle dependency property.

ItemTitleFontWeightProperty static

public static readonly DependencyProperty ItemTitleFontWeightProperty

Identifies the ItemTitleFontWeight dependency property.

ItemTitleProperty static

public static readonly DependencyProperty ItemTitleProperty

Identifies the ItemTitle dependency property.

ItemTitleTextMarginProperty static

public static readonly DependencyProperty ItemTitleTextMarginProperty

Identifies the ItemTitleTextMargin dependency property.