Fluent Creation: Creating FMX Components at Runtime - CodeRage 2019

preview_player
Показать описание
Embarcadero MVP Frank Lauter demonstrates the benefits of a fluent interface and demonstrates a handy method for creating FireMonkey components at runtime.
Рекомендации по теме
Комментарии
Автор

Yeah ... the music is distracting. And also ... when creating components at runtime ... always set the Parent property as late as possible. At least in VCL that's very important. Every property you set can have an impact on the (re)drawing process. So when a parent is set ... settting the width -> paint ... setting the Height -> paint ... By only setting the parent after initialising most properties you will skip a few paints of the component and thus improve performance. It might need to come before setting an .Align or .Visible though ... but still ... as late as possible.

StefaanLesage