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

access event handlers for FMX styled objects

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

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);