We've introduced the following APIs that allow you to directly track the AppointmentEditDialogViewModel's save, load and validation state.
- TrackLoad method
- TrackSave method
- TrackValidation method
The new DialogViewModelBase.DialogTitle property allows you to specify a dialog's title text.
C#var viewModel = ASPxScheduler1.OptionsForms.DialogLayoutSettings.AppointmentDialog.ViewModel;
viewModel.TrackLoad((controller) => {
viewModel.DialogTitle = controller.IsNewAppointment ? "Create New Appointment" : "Edit Appointment: " + controller.Subject;
});
viewModel.TrackValidation(() => {
if(string.IsNullOrEmpty(viewModel.Subject) || viewModel.Subject.Length < 3) {
viewModel.IsValid = false;
viewModel.ErrorMessage = "Subject should be at least 3 characters";
}
});