aboutsummaryrefslogtreecommitdiffstatsci
path: root/src/CompilerServices/Bindings.cs
diff options
context:
space:
mode:
authorjpbruyere <jp.bruyere@hotmail.com>2016-08-05 18:32:18 +0200
committerjpbruyere <jp.bruyere@hotmail.com>2016-08-05 18:32:18 +0200
commitb9e90a3df66f4bd8228c1246af830d7801ea57ba (patch)
tree8de343d8341be621c4b5daa12899155e0bc2f26a /src/CompilerServices/Bindings.cs
parente9963abca14fbad8ff6c215e5c9d6b45652b38dc (diff)
TreeView
template access with './', update all templates binding path begining with '/' starts at current level
Diffstat (limited to 'src/CompilerServices/Bindings.cs')
-rw-r--r--src/CompilerServices/Bindings.cs14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/CompilerServices/Bindings.cs b/src/CompilerServices/Bindings.cs
index 397ec39d..40ade60d 100644
--- a/src/CompilerServices/Bindings.cs
+++ b/src/CompilerServices/Bindings.cs
@@ -125,9 +125,17 @@ namespace Crow
} else {
int ptr = 0;
ILayoutable tmp = Source.Instance as ILayoutable;
- if (string.IsNullOrEmpty (bindingExp [0])) {
- //if exp start with '/' => Graphic tree parsing start at top container
- tmp = Interface.CurrentInterface as ILayoutable;
+ //if exp start with '/' => Graphic tree parsing start at source
+ if (string.IsNullOrEmpty (bindingExp [0]))
+ ptr++;
+ else if (bindingExp[0] == "."){ //search template root
+ do {
+ tmp = tmp.Parent;
+ if (tmp == null)
+ return false;
+ if (tmp is Interface)
+ throw new Exception ("Not in Templated Control");
+ } while (!(tmp is TemplatedControl));
ptr++;
}
while (ptr < bindingExp.Length - 1) {