Show: Delphi C++
Display Preferences

FMX.Controls.Presentation.TPresentedControl

From RAD Studio API Documentation
Jump to: navigation, search

FMX.Controls.TStyledControlFMX.Controls.TControlFMX.Types.TFmxObjectSystem.Classes.TComponentSystem.Classes.TPersistentSystem.TObjectTPresentedControl

Delphi

TPresentedControl = class(TStyledControl)

C++

class PASCALIMPLEMENTATION TPresentedControl : public Fmx::Controls::TStyledControl

Properties

Type Visibility Source Unit Parent
class public
FMX.Controls.Presentation.pas
FMX.Controls.Presentation.hpp
FMX.Controls.Presentation FMX.Controls.Presentation

Description

The base class for presented controls that can provide several UI presentations. A presented control uses separate objects to handle a used data (data model) and UI presentation (presentation layer).

The following properties of presented controls that provide a UI presentation:

The presented control instantiates these properties automatically at run time. An empty model is created as soon as you create an instance of a presented control, and the presentation proxy is created when your presented control loads.

Reimplement DefineModelClass to determine the class that a presented control uses for its data model. Reimplement DefinePresentationName to determine the name of the default presentation proxy that a presented control uses. To define a custom name for the presentation proxy of specific instances of a presented control, handle the OnPresentationNameChoosing event instead.

The ControlType property determines whether the presentation layer represents your control using a native control of the platform where your application is running (Platform), or the presentation layer represents your control using the default FireMonkey style system (Styled). On platforms for which FireMonkey does not provide native presentation support, FireMonkey uses the default styled presentation regardless of the value of the ControlType property.

Working with Presentations

Presented controls use the following methods and properties for working with presentations:

Working with Models

Presented controls use the following methods and properties for working with models:

  • The Model property provides access to the data model used by the presented control. This Model data model is created in the constructor of the presented control.
  • The DefineModelClass method returns a class reference to a data model class that the constructor of the current presented control uses to create a data model for the presented control. By default, DefineModelClass returns TDataModel. Descendant classes reimplement DefineModelClass to determine the data model class that a descendant presented control uses for its data model.
  • The GetModel method is used in a descendant presented control class to cast data models to the data model class used with this presented control.

See Also

Personal tools
RAD Studio 10.2 Tokyo
In Other Languages
Previous Versions
Assistance