Skip to main content

TypedBinding<TIn, TOut> Class

Definition

Assembly:Avalonia.Controls.TreeDataGrid
Package:Avalonia.Controls.TreeDataGrid

A binding whose input and output are strongly-typed.

public class TypedBinding<TIn, TOut>

Inheritance: object -> TypedBinding<TIn, TOut>

Remarks

Avalonia.Experimental.Data.TypedBinding<T1, T2> represents a strongly-typed binding as opposed to Avalonia.Data.Binding which boxes value types. It is represented as a set of delegates:

This class represents a binding which has not been instantiated on an object. When the Avalonia.Experimental.Data.TypedBinding<T1, T2>.Bind(Avalonia.AvaloniaObject,Avalonia.DirectPropertyBase{`1}) or Avalonia.Experimental.Data.TypedBinding<T1, T2>.Bind(Avalonia.AvaloniaObject,Avalonia.StyledProperty{`1}) methods are called, then an instance of Avalonia.Experimental.Data.Core.TypedBindingExpression<T1, T2> is created which represents the binding instantiated on that object.

Constructors

NameDescription
TypedBinding<TIn, TOut>No summary available.

TypedBinding<TIn, TOut> Constructor

public TypedBinding<TIn, TOut>()

Methods

NameDescription
Bind (2 overloads)No summary available.
InstanceInstances the binding on a data source.

Bind overloads

Bind Method

public IDisposable Bind(Avalonia.AvaloniaObject target, Avalonia.DirectPropertyBase<TOut> property)
Parameters

target Avalonia.AvaloniaObject

property Avalonia.DirectPropertyBase<TOut>

Returns

IDisposable

Bind Method

public IDisposable Bind(Avalonia.AvaloniaObject target, Avalonia.StyledProperty<TOut> property)
Parameters

target Avalonia.AvaloniaObject

property Avalonia.StyledProperty<TOut>

Returns

IDisposable

Instance Method

Instances the binding on a data source.

public Avalonia.Experimental.Data.Core.TypedBindingExpression<TIn,TOut><TIn, TOut> Instance(TIn source, Avalonia.Data.BindingMode mode)

Parameters

source TIn

The data source.

mode Avalonia.Data.BindingMode

The binding mode.

Returns

Avalonia.Experimental.Data.Core.TypedBindingExpression<TIn,TOut><TIn, TOut>

Properties

NameDescription
FallbackValueGets or sets the value to use when the binding is unable to produce a value.
LinksGets or sets the links in the binding chain.
ModeGets or sets the binding mode.
PriorityGets or sets the binding priority.
ReadGets or sets the read function.
SourceGets or sets the source for the binding.
WriteGets or sets the write function.

FallbackValue Property

Gets or sets the value to use when the binding is unable to produce a value.

public Avalonia.Data.Optional<TOut> FallbackValue { get; set; }

Gets or sets the links in the binding chain.

public Func<TIn, object>[] Links { get; set; }

Mode Property

Gets or sets the binding mode.

public Avalonia.Data.BindingMode Mode { get; set; }

Priority Property

Gets or sets the binding priority.

public Avalonia.Data.BindingPriority Priority { get; set; }

Read Property

Gets or sets the read function.

public Func<TIn, TOut> Read { get; set; }

Source Property

Gets or sets the source for the binding.

public Avalonia.Data.Optional<TIn> Source { get; set; }

Remarks

If unset the source is the target control's Avalonia.StyledElement.DataContext property.

Write Property

Gets or sets the write function.

public Action<TIn, TOut> Write { get; set; }