зеркало из https://github.com/AvaloniaUI/Avalonia.git
Added more documentation about binding.
This commit is contained in:
Родитель
dc6a6feb49
Коммит
f2649d06d6
|
@ -109,6 +109,24 @@ Nice... Lets take this further:
|
|||
Yep, by putting a bang in front of the property name you can **bind** to a property (attached or
|
||||
otherwise) from the object initializer.
|
||||
|
||||
Binding to a property on another control? Easy:
|
||||
|
||||
var control = new Control
|
||||
{
|
||||
Property1 = "Foo",
|
||||
[Attached.Property] = "Bar",
|
||||
[!Property2] = anotherControl[!Property1],
|
||||
}
|
||||
|
||||
Two way binding? Just add two bangs:
|
||||
|
||||
var control = new Control
|
||||
{
|
||||
Property1 = "Foo",
|
||||
[Attached.Property] = "Bar",
|
||||
[!!Property2] = anotherControl[!!Property1],
|
||||
}
|
||||
|
||||
## Visual and Logical trees
|
||||
|
||||
Perspex uses the same visual/logical tree separation that is used by WPF (and to some extent HTML
|
||||
|
|
Загрузка…
Ссылка в новой задаче