我在将字符串属性绑定到TLabel时遇到了问题。
TGotManager = class(TComponent)
..
..
published
property HotQ1: String read FHotQ1 write SetHotQ1;
property HotQ2: string read FHotQ2 write SetHotQ2;
..我创建了一个组件,因为我不想使用TPrototypeDatasource。
我的目标是通过设计器将这两个属性绑定到TLabel.text。
我是在这里的答案的帮助下完成的:Delphi: Making a component visible to live binding
示例1:
//with this only HotQ1 is bindable via the designer.
[ObservableMember('HotQ1')]
TGotManager = class(TComponent)示例2:
//with this only HotQ2 is bindable via the designer.
[ObservableMember('HotQ1')]
[ObservableMember('HotQ2')]
TGotManager = class(TComponent)问题是我只能通过设计器绑定一个属性。当拖动该属性时,其他兼容的属性会亮起绿色。拖动第二个属性时,其他属性保持为红色。
发布于 2016-06-17 23:14:21
我没有得到一个以上的属性来处理可视化的Livebindings。我确实通过以下方式让它工作:
http://docwiki.embarcadero.com/RADStudio/Seattle/en/The_Entire_Project_and_Observing_the_Results
这里来自澳大利亚用户组:http://www.adug.org.au/technical/vcl/using-livebindings-to-connect-the-ui-to-objects/,以供参考和进一步自动化
我不接受这个作为答案,因为这并没有解决问题。它提供了一种变通方法。
https://stackoverflow.com/questions/37780008
复制相似问题