diff --git a/src/FubuCore/Binding/ArrayPropertyBinder.cs b/src/FubuCore/Binding/ArrayPropertyBinder.cs index f57d5fa..65aaef4 100644 --- a/src/FubuCore/Binding/ArrayPropertyBinder.cs +++ b/src/FubuCore/Binding/ArrayPropertyBinder.cs @@ -43,6 +43,10 @@ public class ArrayBuilder : IArrayBuilder public void FillValues(PropertyInfo property, IBindingContext context) { var requests = context.GetEnumerableRequests(property.Name).ToList(); + + // TODO -- need an end to end test on this behavior + if (!requests.Any()) return; + var data = new T[requests.Count]; for (int i = 0; i < requests.Count; i++) diff --git a/src/FubuCore/Binding/InMemory/RecordingBindingLogger.cs b/src/FubuCore/Binding/InMemory/RecordingBindingLogger.cs index 6be7031..b785c1a 100644 --- a/src/FubuCore/Binding/InMemory/RecordingBindingLogger.cs +++ b/src/FubuCore/Binding/InMemory/RecordingBindingLogger.cs @@ -91,7 +91,7 @@ public void UsedValue(BindingValue value) { if (_models.Any()) { - currentReport.LastProperty.Used(value); + currentReport.Used(value); } } diff --git a/src/FubuCore/Binding/Logging/BindingReport.cs b/src/FubuCore/Binding/Logging/BindingReport.cs index 7d17ba6..3f0b722 100644 --- a/src/FubuCore/Binding/Logging/BindingReport.cs +++ b/src/FubuCore/Binding/Logging/BindingReport.cs @@ -94,5 +94,14 @@ public PropertyBindingReport For(Expression> expression) var property = expression.ToAccessor().InnerProperty; return For(property); } + + // TODO -- what if Value() is used outside the context of a property? + public void Used(BindingValue value) + { + if (_properties.Any()) + { + LastProperty.Used(value); + } + } } } \ No newline at end of file