protected View(Map instance)
{
instance._thisView = this;
_map = instance;
// add the property lookup as the first macro resolver
// (since they get reversed, it ends up being last)
_map.GetMacroValue += LookupPropertyForMacro;
// add the Defined Macro resolver next
// (which makes it higher priority than properties)
_map.GetMacroValue += ResolveDefinedMacro;
_map._resolveValue = () => {
// is there a property, and can it take a value?
if (_map._thisView.HasProperty && _map is ICanSetBackingValues) {
// prefer those who can take a collection
_map._thisView.AggregatePropertyNode.SetResults(map as ICanSetBackingValues, _map._thisView);
} else {
// but single values are good too.
if(_map._thisView.HasProperty && _map is ICanSetBackingValue) {
_map._thisView.AggregatePropertyNode.SetResult(map as ICanSetBackingValue, _map._thisView);
}
}
_map.Active = true;
// regardless, never call this again...
_map._resolveValue = RESOLVED;
};
}