To get started with live bindings i am currently writing some demo code. But at one point i have a problem where i don't find any documentation on.
I have a form with multiple TEdit's and want to bind them with an TBindScope to properties of an object. I setup the BindScope and the BindingList and everything works for the moment when i do BindExpression1.Active := true;
But now i change the properties of the object and want to notify the BindingList about an update.
Here is the Problem. I cant find any way to notify the BindingList, so it updates the values. But if i do a BindExpression1.Evaluate it synchronises the values.
I tried using
- BindingList.Notify(BindScope, 'Object.Property')
- BindingList.Notify(BindScope, 'Object')
- BindingList.Notify(Object, 'Property');
- BindingList.Notify(BindScope, 'Property');
- BindingList.Notify(BindScope, 'Active');
Nothing seems to work for the notification.
P.S. : I know that in this case the BindScope is not necessarely needed. But since its demo code for understanding, i would like to know how it works with the BindScope.
Thanks.
See the source code of
TCustomBindScope.GetValue
for details on how the scope is resolved.Component
is used if assigned, otherwiseDataObject
is used if assigned, otherwiseOwner
is usedSo the simplest solution is probably to leave the
Component
property (of your TBindScope component) unassigned and make yourObject
a property of the owner form.