ItemView<TItem>

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

Properties

Content

The cell's element tree.

Type: View?

public View? Content { get; set; }

Item

The item this cell shows. Swapped on reuse; the bindings re-fire.

Type: TItem?

public TItem? Item { get; set; }

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, or null when it is cleared.