Model: IUiModel;
The Model property determines the UiModel component that is used as a data source.
Executing the example requires that repository contains:
A form with the following:
A button with the Button1 identifier.
The ModelBox component with the ModelBox1 identifier.
The UiModel component with the UiModel11 identifier. The UiModel1 component is a data source for ModelBox1 and contains a loaded model.
Add links to the Metabase, Ms, Ui system assemblies.
The example is a handler of the OnClick event for the Button1 button.
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 will be loaded to the UiModel1 component on the button click. This model parameters are displayed in the ModelBox1 component.
See also: