IsDirty: Boolean;
The IsDirty property returns whether the model displayed by the component is changed.
Available values:
True. The model is changed. To save changes, use the IModelBox.SaveObject method.
False. Model has not changed.
Executing the example requires that the repository contains a form with the following:
A button with the Button1 identifier
The ModelBox component with the ModelBox1 identifier.
The UiModel component that is a data source for ModelBox1. A model must be loaded to UiModel.
Add links to the Ms and Ui system assemblies.
The example is a handler of the OnClick event for the Button1 button.
Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Var
yes: Boolean;
Begin
If ModelBox1.IsDirty Then
WinApplication.YesNoCancelBox("The model has changed. Do you want to save changes?", yes);
If yes Then
ModelBox1.SaveObject;
End If;
Else
WinApplication.InformationBox("Model is not changed");
End If;
End Sub Button1OnClick;
After executing the example, if the displayed model is changed, it is prompted to save changes.
See also: