Five New Optimizely Certifications are Here! Validate your expertise and advance your career with our latest certification exams. Click here to find out more
AI OnAI Off
Five New Optimizely Certifications are Here! Validate your expertise and advance your career with our latest certification exams. Click here to find out more
I don't think you can use IValidate here, but throwing an exception would halt the operation. maybe not as nice as a warning, but should still work
this
var dto = sender as CatalogRelationDto;
if (dto.CatalogEntryRelation.Any(x => x.RowState != System.Data.DataRowState.Unchanged))
{
throw new InvalidOperationException("this can be done");
}
would show this
Im want to display error message to UI when user change the quantity of package entry.
Im firgured out has a way to validate data of CatalogRelationDto by using ICatalogEvents like this:
public void Initialize(InitializationEngine context) { var catalogEvent = ServiceLocator.Current.GetInstance<ICatalogEvents>(); catalogEvent.RelationUpdating += CatalogEvent_RelationUpdating; } private void CatalogEvent_RelationUpdating(object sender, RelationEventArgs e) { if (sender is CatalogRelationDto) { // TODO: Validate data // TODO: Show error message } }
But currently im have no idear to show error message to UI like IValidate behavior.
Does any one have some idear?
Thanks alot.