ItemView<TItem>

The element tree for one item in a CollectionView.
public abstract class ItemView<TItem> : ContentHost where TItem : class
Type parameterSummary
(class) TItemThe item type the cell shows.

Constructors

protected ItemView()

Properties

Accessories

The native affordances pinned to this item's edges.

Configure the collection in the template constructor. Later changes update the cell in place.

Type: IList<ItemAccessory>

public IList<ItemAccessory> Accessories { get; }

HighlightBackground

The background shown while the cell is pressed, and while selected when the collection retains the highlight. Null disables the highlight.

Type: BindableBrush?

public BindableBrush? HighlightBackground { get; set; }

Item

The item this cell shows, or null before its first assignment. Swapped by the owning collection on reuse; the bindings re-fire.

Type: TItem?

public TItem? Item { get; }

SkeleKit.ICollectionItemView.Accessories

Type: IReadOnlyList<ItemAccessory>

private IReadOnlyList<ItemAccessory> ICollectionItemView.Accessories { get; }

SkeleKit.ICollectionItemView.CurrentItem

Type: object?

private object? ICollectionItemView.CurrentItem { get; }

SkeleKit.ICollectionItemView.HighlightBackground

Type: Brush?

private Brush? ICollectionItemView.HighlightBackground { get; }

SkeleKit.ICollectionItemView.View

Type: View

private View ICollectionItemView.View { get; }

Methods

ArrangeOverride

Content arrangement. Panels override to place their children.

protected override Size ArrangeOverride(
  Size finalSize)
ParameterSummary
Size finalSizeThe final size available for the view's content.

Returns

  • Size: The arranged content size.

Bind

Starts a binding that can only write control values to the item.

protected static ToSourceBindingBuilder<TItem> Bind()

Returns

Bind

Binds one way to an item property.

protected static BindingExpression<TItem, TItem, T> Bind<T>(
  Func<TItem, T> read,
  string? path = null)
ParameterSummary
Func<TItem, T> readThe item property to read.
(optional) string? pathThe source lambda, captured automatically to derive the property path.
Type parameterSummary
TThe bound value type.

Returns

MeasureOverride

Content measurement. Panels recurse; controls delegate to the native SizeThatFits.

protected override Size MeasureOverride(
  Size availableSize)
ParameterSummary
Size availableSizeThe size available for the view's content.

Returns

  • Size: The desired content size.

OnItemChanged

Raised whenever this recycled view receives a different item.

protected virtual void OnItemChanged(
  TItem item)
ParameterSummary
TItem itemThe item now represented by the view.