【发布时间】:2016-06-12 23:12:54
【问题描述】:
我在将字符串属性绑定到 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)
问题是我只能通过设计器绑定一个属性。拖动该属性时,其他兼容的属性会亮起绿色。拖动第二个属性时,其他属性保持红色。
【问题讨论】:
-
“我只用一个属性成功了” 那么,你在其他属性上的失败是如何表现出来的呢?
-
@martynA 我会编辑问题并解释
-
@martynA 我希望它现在清楚
标签: delphi firemonkey livebindings