aboutsummaryrefslogtreecommitdiffstatsci
path: root/src/CompilerServices
diff options
context:
space:
mode:
authorjpbruyere <jp.bruyere@hotmail.com>2015-09-12 18:38:45 +0200
committerjpbruyere <jp.bruyere@hotmail.com>2015-09-12 18:38:45 +0200
commit8624ae1ead48d7ddc206486db0c4fc024afac703 (patch)
tree5ca2473a7d36d8404a012a2b4fd0d51c1d501ab6 /src/CompilerServices
parented5441de78ea4637d8e326462bf32746e8adc8bd (diff)
Allow one way binding with MemberLess value passed as string with ValueChanched event
Diffstat (limited to 'src/CompilerServices')
-rw-r--r--src/CompilerServices/CompilerServices.cs8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/CompilerServices/CompilerServices.cs b/src/CompilerServices/CompilerServices.cs
index 1aaeac99..f383c8ee 100644
--- a/src/CompilerServices/CompilerServices.cs
+++ b/src/CompilerServices/CompilerServices.cs
@@ -322,13 +322,19 @@ namespace go
PropertyInfo piTarget = dstType.GetProperty(binding.MemberName);
Type srcValueType = null;
+
+ if (miSrc == null)
+ //this allow memberless binding with only a name passed as MemberName
+ //but the value passed has to be a string
+ srcValueType = typeof(string);
+ else{
if (miSrc.MemberType == MemberTypes.Property)
srcValueType = (miSrc as PropertyInfo).PropertyType;
else if (miSrc.MemberType == MemberTypes.Field)
srcValueType = (miSrc as FieldInfo).FieldType;
else
throw new Exception("unandled source member type for binding");
-
+ }
if (!srcValueType.IsValueType)
il.Emit(OpCodes.Castclass, srcValueType);
else if (piTarget.PropertyType != srcValueType)