/// <summary> /// Create a new attribute which hooks a coercion handler to a dependency property. /// </summary> /// <param name = "dynamicType"> /// The type of the coercion handler. /// Should extend from <see cref = "AbstractControlCoercion{T, U}" />.</param> /// <param name = "constructorArguments">The arguments to pass to the constructor of the validation handler.</param> public CoercionHandlerAttribute(Type dynamicType, params object[] constructorArguments) : base(dynamicType, constructorArguments) { Contract.Requires(dynamicType.IsOfGenericType(typeof(IControlCoercion <,>))); GenericCoercion = Proxy.CreateGenericInterfaceWrapper <IControlCoercion <object, object> >(DynamicInstance); }
/// <summary> /// Create a new attribute which hooks a coercion handler to a dependency property. /// </summary> /// <param name = "dynamicType"> /// The type of the coercion handler. /// Should extend from <see cref = "AbstractControlCoercion{T, U}" />.</param> /// <param name = "constructorArguments">The arguments to pass to the constructor of the validation handler.</param> public CoercionHandlerAttribute( Type dynamicType, params object[] constructorArguments ) : base( dynamicType, constructorArguments ) { Contract.Requires( dynamicType.IsOfGenericType( typeof( IControlCoercion<,> ) ) ); GenericCoercion = Proxy.CreateGenericInterfaceWrapper<IControlCoercion<object, object>>( DynamicInstance ); }