aboutsummaryrefslogtreecommitdiffstatsci
path: root/src/CompilerServices
diff options
context:
space:
mode:
Diffstat (limited to 'src/CompilerServices')
-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) {