Cocktail Help Reference
IValidationErrorNotification Interface
Members  Example  See Also  Send Feedback
Cocktail Assembly > Cocktail Namespace : IValidationErrorNotification Interface



Glossary Item Box

Implement this interface to be notified of validation errors during a save. The framework automatically performs validation before saving changed entities. If any validation errors occur, the save is aborted and any implementation of IValidationErrorNotification is notified of the error(s).

Syntax

Visual Basic (Declaration) 
<IdeaBlade.Core.Composition.InterfaceExportAttribute(ContractName="", ContractType=Cocktail.IValidationErrorNotification)>
Public Interface IValidationErrorNotification 
   Inherits IdeaBlade.Core.IHideObjectMembers 
Visual Basic (Usage)Copy Code
Dim instance As IValidationErrorNotification
C# 
[IdeaBlade.Core.Composition.InterfaceExportAttribute(ContractName="", ContractType=Cocktail.IValidationErrorNotification)]
public interface IValidationErrorNotification : IdeaBlade.Core.IHideObjectMembers  
C++/CLI 
[IdeaBlade.Core.Composition.InterfaceExportAttribute(ContractName="", ContractType=Cocktail.IValidationErrorNotification)]
public interface class IValidationErrorNotification : public IdeaBlade.Core.IHideObjectMembers  

Example

In this example, the implementation of IValidationErrorNotification publishes a message to the UI EventAggregator for consumption by any view model and processing of the validation error.
C#Copy Code
// Create this implementation as a singleton.
[PartCreationPolicy(CreationPolicy.Shared)]
public class ValidationErrorProcessor : IValidationErrorNotification
{
    // Let the UI know that a validation error occurred.
    public OnValidationError(VerifierResultCollection validationErrors)
    {
        EventFns.Publish(new HandleValidationErrors(validationErrors));
    }
}

Requirements

Target Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, Windows Vista, Windows Server 2008 family

See Also

© 2013 All Rights Reserved.