TX = class(...)
private
Fa: ...;
FaChanged: TNotifyEvent;
procedure SetaProperty(const Value: ...);
public
property a: ... read Fa writeSetaProperty;
property aChanged: TNotifyEvent write FaChanged;
end;
实现部分
procedure TX.etaProperty(const Value: ...);
begin
if a <> Value then
begin
a := Value;
if Assigned(FaChanged) then
FaChanged(Self);
end;
end;
=====================================================
那么在实例化 X 时,
X := TX.Create(...);
X.aChanged := XaChanged;
其中 XaChanged 是一个类过程, 如:
procedure TForm1.XaChanged(Sender: TObject);
begin
if Y <> nil then
begin
Y.a := X.a;
end;
end;