Dave Nottage 557 Posted December 24, 2020 (edited) I have an FMX component with a published TBitmap property, but the property is not being read when the component is loaded (the other properties are). Holger Flick's article suggests that it is possible: https://flixengineering.com/archives/166 Is there something special I need to do to make it work? This is what the declaration looks like: TCustomNativeDoodad = class(TPresentedControl) private function GetMaxImage: TBitmap; function GetMinImage: TBitmap; function GetModel: TCustomNativeDoodadModel; overload; function GetValue: Single; procedure SetValue(const Value: Single); function GetOnValueChange: TNotifyEvent; function GetOrientation: TDoodadOrientation; procedure SetMaxImage(const Value: TBitmap); procedure SetMinImage(const Value: TBitmap); procedure SetOnValueChange(const Value: TNotifyEvent); procedure SetOrientation(const Value: TDoodadOrientation); protected function DefineModelClass: TDataModelClass; override; function RecommendSize(const AWishedSize: TSizeF): TSizeF; override; public constructor Create(AOwner: TComponent); override; property MaxImage: TBitmap read GetMaxImage write SetMaxImage; property MinImage: TBitmap read GetMinImage write SetMinImage; property Model: TCustomNativeDoodadModel read GetModel; property Orientation: TDoodadOrientation read GetOrientation write SetOrientation; property Value: Single read GetValue write SetValue; property OnValueChange: TNotifyEvent read GetOnValueChange write SetOnValueChange; end; [ComponentPlatformsAttribute(pfidiOS or pidAndroid)] TNativeDoodad = class(TCustomNativeDoodad) published property Align; property Anchors; property Height; property Margins; property MaxImage; property MinImage; property Orientation; property Position; property Size; property Value; property Visible default True; property Width; property OnValueChange; end; SetMaxImage and SetMinImage are not being called when the component is being loaded Edited December 24, 2020 by Dave Nottage Additional info Share this post Link to post
Dave Nottage 557 Posted December 24, 2020 2 hours ago, Dave Nottage said: SetMaxImage and SetMinImage are not being called when the component is being loaded Which is the whole problem - they're not called when the values are streamed. I needed to override the Loaded method to see that they are. Share this post Link to post