I'm using TPrototypeBindSource to bind some object property to visual control. Everything works correctly but I have to create this object in TPrototypeBindSource.OnCreateAdapter like that:
procedure TForm.PrototypeBindSourceCreateAdapter(Sender: TObject;
var ABindSourceAdapter: TBindSourceAdapter);
begin
_viewModel := TViewModel.Create;
ABindSourceAdapter := TObjectBindSourceAdapter<TViewModel>.Create(self,
_viewModel);
end;
I want move creating _viewModel to form's constructor but then it stops working. Probably because OnCreateAdapter is calling before FormCreate. There is any way to create _viewModel outside of OnCreateAdapter event?
edited: Delphi Tokyo 10.2