Table of Contents

Class InheritDataTypeFromItemsAttribute

Namespace
Avalonia.Metadata
Assembly
Avalonia.Base.dll

Instructs the compiler to resolve the compiled bindings data type for the item-specific properties of collection-like controls.

[AttributeUsage(AttributeTargets.Property, AllowMultiple = false, Inherited = true)]
public sealed class InheritDataTypeFromItemsAttribute : Attribute
Inheritance
InheritDataTypeFromItemsAttribute
Inherited Members

Remarks

A typical usage example is a ListBox control, where InheritDataTypeFromItemsAttribute is defined on the ItemTemplate property, allowing the template to inherit the data type from the Items collection binding.

Constructors

InheritDataTypeFromItemsAttribute(string)

Initializes a new instance of the InheritDataTypeFromItemsAttribute class.

public InheritDataTypeFromItemsAttribute(string ancestorItemsProperty)

Parameters

ancestorItemsProperty string

The name of the property whose item type should be used on the target property.

Properties

AncestorItemsProperty

The name of the property whose item type should be used on the target property.

public string AncestorItemsProperty { get; }

Property Value

string

AncestorType

The ancestor type to be used in a lookup for the AncestorItemsProperty. If null, the declaring type of the target property is used.

public Type? AncestorType { get; set; }

Property Value

Type