Model: IMsModel;
The Model property determines the model of the modeling container, to which access must be obtained.
Executing the example requires a form, a button named Button1 on the form, 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.
The example is a handler of the OnClick event for the button.
Add links to the Forms, Metabase, and Ms system assemblies.
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: