IUiModel.Model

Syntax

Model: IMsModel;

Description

The Model property determines the model of the modeling container, to which access must be obtained.

Example

Executing the example requires a form with the Button1 button on it, the ModelBox component and the UiModel component named UiModel1 that is a data source for ModelBox. The repository contains a modeling container with the KONT_MODEL identifier and a model with the Model_1 identifier, created in it.

Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);

Var

MB: IMetabase;

Begin

MB := MetabaseClass.Active;

UiModel1.Active := False;

UiModel1.Model := MB.ItemByIdNamespace("Model_1", MB.ItemById("KONT_MODEL").Key).Bind As IMsModel;

ModelBox1.Model := UiModel1;

UiModel1.Active := True;

End Sub Button1OnClick;

After executing the example the Model_1 model is loaded to the UiModel1 component on the button click. This model parameters are displayed in the ModelBox component.

See also:

IUiModel