From f2649d06d66efbefd4db471ad517ab48ce7be76d Mon Sep 17 00:00:00 2001 From: Steven Kirk Date: Mon, 8 Dec 2014 10:50:24 +0100 Subject: [PATCH] Added more documentation about binding. --- Docs/intro.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/Docs/intro.md b/Docs/intro.md index e332f1f7a5..aba5ea1489 100644 --- a/Docs/intro.md +++ b/Docs/intro.md @@ -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