From 6bedf8d5d0b78ba0705e37375d8dee016e87ebbb Mon Sep 17 00:00:00 2001 From: jpbruyere Date: Tue, 13 Oct 2015 16:57:26 +0200 Subject: - GraphicTree parsing bindings in templates instead of using datasource which could be kept for other uses - ListBox bindings debug - LogicalParent for Popper to get correct DataSource for content --- src/CompilerServices/CompilerServices.cs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/CompilerServices') diff --git a/src/CompilerServices/CompilerServices.cs b/src/CompilerServices/CompilerServices.cs index c72137df..e7395383 100644 --- a/src/CompilerServices/CompilerServices.cs +++ b/src/CompilerServices/CompilerServices.cs @@ -29,6 +29,8 @@ namespace go } public bool FindMember(string _memberName) { + if (Instance == null) + return false; Type t = Instance.GetType (); Member = t.GetMember (_memberName,BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Instance).FirstOrDefault (); @@ -79,7 +81,7 @@ namespace go //if binding exp = '{}' => binding is done on datasource if (string.IsNullOrEmpty (Expression)) { - Target = new MemberReference (Source.Instance); + Target = new MemberReference ((Source.Instance as GraphicObject).DataSource); return true; } @@ -101,7 +103,7 @@ namespace go if (tmp == null) return false; if (bindingExp [ptr] == "..") - tmp = tmp.Parent as GraphicObject; + tmp = tmp.Parent as ILayoutable; else if (bindingExp [ptr] == ".") { if (ptr > 0) throw new Exception ("Syntax error in binding, './' may only appear in first position"); @@ -111,6 +113,9 @@ namespace go ptr++; } + if (tmp == null) + return false; + string[] bindTrg = bindingExp [ptr].Split ('.'); if (bindTrg.Length == 1) -- cgit v1.3.1-4-g156e