I want to use the OnNotify event of a generic TList. Assigning a procedure to OnNotify yields the error message:
E2010 Incompatible types: 'System.Generics.Collections.TCollectionNotification' and 'System.Classes.TCollectionNotification'
I am declaring a class and in it a generic TList is used as follows:
TEditor_Table = class (TObject)
public
FEditors: TList<TGradient_Editor>; // List containing the editors
This is not the neatest way of doing it but I need this for a test. The list is instantiated in the constructor:
constructor TEditor_Table.Create (Owner: TFMXObject);
begin
inherited Create;
FEditors := TList<TGradient_Editor>.Create;
FOwner := Owner;
end; // Create //
Next in the main form a function is declared
procedure do_editor_change (Sender: TObject; const Item: TGradient_Editor; Action: TCollectionNotification);
and the TColor_Editor class is instantiated as follows:
FColor_Editor := TEditor_Table.Create (List_Gradients);
FColor_Editor.FEditors.OnNotify := do_editor_change;
^
error occurs here----------------------------------+
I do not understand the message at all and I am at a los why the compiler seems to confuse the two units: 'System.Generics.Collections.TCollectionNotification' and 'System.Classes.TCollectionNotification'. What am I doing wrong?