1
votes

I've got problems with binding string properties to TLabel.

TGotManager = class(TComponent)
..
..
published
  property HotQ1: String read FHotQ1 write SetHotQ1;
  property HotQ2: string read FHotQ2 write SetHotQ2;
..

I did create a component because I don't want to use a TPrototypeDatasource.

My goal is to bind both properties to TLabel.text via the designer.

I did this with help from the answer here: Delphi: Making a component visible to live binding

Example 1:

//with this only HotQ1 is bindable via the designer.
[ObservableMember('HotQ1')] 
TGotManager = class(TComponent)

Example 2:

//with this only HotQ2 is bindable via the designer.
[ObservableMember('HotQ1')] 
[ObservableMember('HotQ2')] 
TGotManager = class(TComponent)

The problem is that I only can bind one property via the designer. When dragging that property other ones which are compatible light up green. When dragging the second property the other ones stay red.

1
"I succeeded with only one property" Well, how does your lack of success with the other property manifest itself?MartynA
@martynA I will edit the question and explainEdward
@martynA I hope its clear nowEdward

1 Answers

0
votes

I don't get more then one property to work with visual Livebindings. I do get it to work via:

http://docwiki.embarcadero.com/RADStudio/Seattle/en/The_Entire_Project_and_Observing_the_Results

also for reference and automating things further this page from the Australian user group: http://www.adug.org.au/technical/vcl/using-livebindings-to-connect-the-ui-to-objects/

I don't accept this as an answer because this did not solve the problem. It provided a work around.