From cc4c62ab5d809ff451ca475a7949adc4fdfd806b Mon Sep 17 00:00:00 2001 From: jpbruyere Date: Mon, 8 Aug 2016 19:22:52 +0200 Subject: IMLInstantiator implementation --- src/CompilerServices/Bindings.cs | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'src/CompilerServices/Bindings.cs') diff --git a/src/CompilerServices/Bindings.cs b/src/CompilerServices/Bindings.cs index 8ece856c..0ce8da6e 100644 --- a/src/CompilerServices/Bindings.cs +++ b/src/CompilerServices/Bindings.cs @@ -41,6 +41,11 @@ namespace Crow public string DynMethodId { get { return dynMethodId; } } + public Type SourceType { + get { return Source == null ? null + : Source.Instance == null ? null + : Source.Instance.GetType();} + } public bool Resolved { get { return resolved; } @@ -185,12 +190,8 @@ namespace Crow } if (Target.TryFindMember (memberName)) { - if (TwoWayBinding) { - IBindable source = Target.Instance as IBindable; - if (source == null) - throw new Exception (Source.Instance + " does not implement IBindable for 2 way bindings"); - source.Bindings.Add (new Binding (Target, Source)); - } + if (TwoWayBinding) + Interface.RegisterBinding (new Binding (Target, Source)); } #if DEBUG_BINDING else -- cgit v1.3.1-4-g156e