This came up recently with a DateTimePropertyBinder we made to bind a
date based on three inputs coming in.
To provide some context, we have a separate HtmlConvention that spits
out DateTimes as three inputs named like this:
propertyName + "Day"
propertyName + "Month"
propertyName + "Year"
and then the property binder which will look through the request data
for the same in order to bind it back in.
Consider the following example:
public class InputModel
{
public IList<Person> People { get; set;}
}
public class Person
{
public DateTime DateOfBirth { get; set;}
}
with some spark markup on page looking like this:
<div each="var person in Model.People">
${ this.InputFor(x => x.People[personIndex].DateOfBirth) }
</div>
**NOTE** this didn't work until quite recently when Jeremy fixed it to
allow access to a variable instead of an int constant like 0
So now in the property binder, we get handed the PropertyInfo and the
IBindingContext in order to make decisions about how to piece this
value back together. For our first attempt we just used the
context.Service<IRequestData> to get access to the request data but
for the collection binding scenario what we really need is the
PrefixedRequestData that sits inside the context, so I figured it
would be ok to expose it unless for property binders to use.
https://github.com/DarthFubuMVC/fubucore/pull/31