InheritDataTypeFromItemsAttribute Class
Definition
Instructs the compiler to resolve the compiled bindings data type for the item-specific properties of collection-like controls.
public class InheritDataTypeFromItemsAttribute
Remarks
A typical usage example is a ListBox control, where Avalonia.Metadata.InheritDataTypeFromItemsAttribute is defined on the ItemTemplate property, allowing the template to inherit the data type from the Items collection binding.
Constructors
| Name | Description |
|---|---|
| InheritDataTypeFromItemsAttribute | Initializes a new instance of the Avalonia.Metadata.InheritDataTypeFromItemsAttribute class. |
InheritDataTypeFromItemsAttribute Constructor
Initializes a new instance of the Avalonia.Metadata.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
| Name | Description |
|---|---|
| AncestorItemsProperty | The name of the property whose item type should be used on the target property. |
| AncestorType | The ancestor type to be used in a lookup for the Avalonia.Metadata.InheritDataTypeFromItemsAttribute.AncestorItemsProperty. If null, the declaring type of the target property is used. |
AncestorItemsProperty Property
The name of the property whose item type should be used on the target property.
public string AncestorItemsProperty { get; set; }
AncestorType Property
The ancestor type to be used in a lookup for the Avalonia.Metadata.InheritDataTypeFromItemsAttribute.AncestorItemsProperty. If null, the declaring type of the target property is used.
public Type AncestorType { get; set; }