首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >自定义组件属性LiveBindings

自定义组件属性LiveBindings
EN

Stack Overflow用户
提问于 2016-06-13 07:12:55
回答 1查看 378关注 0票数 1

我在将字符串属性绑定到TLabel时遇到了问题。

代码语言:javascript
复制
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:

代码语言:javascript
复制
//with this only HotQ1 is bindable via the designer.
[ObservableMember('HotQ1')] 
TGotManager = class(TComponent)

示例2:

代码语言:javascript
复制
//with this only HotQ2 is bindable via the designer.
[ObservableMember('HotQ1')] 
[ObservableMember('HotQ2')] 
TGotManager = class(TComponent)

问题是我只能通过设计器绑定一个属性。当拖动该属性时,其他兼容的属性会亮起绿色。拖动第二个属性时,其他属性保持为红色。

EN

回答 1

Stack Overflow用户

发布于 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/,以供参考和进一步自动化

我不接受这个作为答案,因为这并没有解决问题。它提供了一种变通方法。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/37780008

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档