访问FMX样式对象的事件处理程序

如何访问样式按钮的事件处理程序。例如,这有效:

ListBoxItem.StylesData['detail2.text'] := date;

但不是这样:

ListBoxItem.StylesData['downloadbutton.OnClick'] := LoadFileContent; //says not enough parameters. So when I put in 'LoadFileContent(nil) then I get an imcompatible types error message

这应该这样做:

uses
  //....
  System.Rtti;
  //....
  ListBoxItem.StylesData['downloadbutton.OnClick'] := TValue.From<TNotifyEvent>(LoadFileContent);

原文地址

https://www.thinbug.com/q/28440806

原文地址:https://www.cnblogs.com/kinglandsoft/p/15055010.html