I want to be able to add properties to a class at runtime and access these properties later through a BindingExtension such as:
class PropertiesHolder {
properties = [];
}
class PropertiesAdder {
propertiesHolder.properties.add(PropertyA);
propertiesHolder.properties.add(PropertyB);
}
Content="{Binding PropertyB}"
Then the XAML would retrieve the value stored in the object “PropertyB”
The issue I face is that there is no way to distinguish between these different properties. I can dynamically throw a bunch into an ObservableCollection or something, but if I create two or more, I don’t know how to differentiate between them with the data binding since the Binding takes a path pointing to the property. I couldn’t say, store a UID in the property, since the Binding won’t care about information inside the object until it first gets the object, obviously.
Grant is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.