delphi中的livebinding接口

时间:2012-01-25 20:57:45

标签: delphi interface delphi-xe2 firemonkey livebindings

我使用Delphi FireMonkey平台创建了一个小项目来试用新的实时绑定功能。我想用TList<IFoo>项填充TListBox,然后使用BOCollection exampleBindList.FormatExpressions[0]的值与示例中的值类似。

ControlExpression = 'Text'
SourceExpression = 'Current.Name'

现在,如果我拨打BindList.FillList,我会收到例外情况“无法找到姓名”。但是,如果我使用对象列表(TList<TFoo>而不是TList<IFoo>),则不会引发异常并且列表正确填充 - 它可以正常工作!所以看起来livebinding找不到接口的属性。

IFoo的定义如下:

IFoo = interface
  function GetName: string;
  procedure SetName(const AValue: string);
  property Name: string read GetName write SetName;
end;

是否可以使用接口进行实时绑定?

0 个答案:

没有答案