Share via


RequirementValidator Class

Determines whether the required context and services are available for the specified type.

Inheritance Hierarchy

System.Object
  Microsoft.Windows.Design.RequirementValidator

Namespace:  Microsoft.Windows.Design
Assembly:  Microsoft.Windows.Design.Extensibility (in Microsoft.Windows.Design.Extensibility.dll)

Syntax

'Declaration
Public NotInheritable Class RequirementValidator
public sealed class RequirementValidator
public ref class RequirementValidator sealed
[<Sealed>]
type RequirementValidator =  class end
public final class RequirementValidator

The RequirementValidator type exposes the following members.

Constructors

  Name Description
Public method RequirementValidator Initializes a new instance of the RequirementValidator class for the specified FeatureManager and type.

Top

Properties

  Name Description
Public property MeetsRequirements Gets a value that indicates whether the type requirements exist in the editing context.
Public property PendingRequirements Gets a list of pending requirement attributes.
Public property Requirements Gets an enumeration of all requirements for the type contained in this validator.
Public property Type Gets the type of object to validate requirements for.

Top

Methods

  Name Description
Public method Equals Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Protected method Finalize Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Public method GetHashCode Serves as a hash function for a particular type. (Inherited from Object.)
Public method GetType Gets the Type of the current instance. (Inherited from Object.)
Protected method MemberwiseClone Creates a shallow copy of the current Object. (Inherited from Object.)
Public method ToString Returns a string that represents the current object. (Inherited from Object.)

Top

Events

  Name Description
Public event RequirementsChanged Occurs when the set of requirements necessary to use the type have changed.

Top

Remarks

Use the RequirementValidator class to defer creation of objects that do not have their requirements in place. An object may specify a requirement to a service or context item by adding a RequiresServiceAttribute or RequiresContextItemAttribute on its class. Areas of the designer that automatically create objects check these attributes to make sure that the object can be used in the designer context.

You can define other types of requirements by deriving from RequirementAttribute and implementing the abstract MeetsRequirement method.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

See Also

Reference

Microsoft.Windows.Design Namespace

RequiresServiceAttribute

RequiresContextItemAttribute

UsesItemPolicyAttribute

PrimarySelectionPolicy

FeatureProvider

Other Resources

Feature Providers and Feature Connectors

Understanding WPF Designer Extensibility