/// <summary> Initializes a new instance of the <see cref="EnumMemberVM<T>"/> class. /// </summary> /// <param name="value">The value.</param> /// <remarks></remarks> public EnumMemberVM(T value) { Metadata = new ViewModelMetadata { DisplayValueProvider = new EnumDisplayValueProvider() }; ((EnumDisplayValueProvider)Metadata.DisplayValueProvider).SetValue(value.ToString()); base.Value = value; }
/// <summary> Initializes a new instance of the <see cref="ViewModelProperty"/> class. /// </summary> /// <param name="name">The name of the property</param> /// <param name="propertyType">Type of the property.</param> /// <param name="ownerType">Type of the owner.</param> /// <param name="typeMetadata">The type metadata.</param> /// <param name="validateValueCallback">The validate value callback.</param> /// <param name="readOnly">if set to <c>true</c> [read only].</param> /// <remarks></remarks> protected ViewModelProperty(string name, Type propertyType, Type ownerType, ViewModelMetadata typeMetadata, ValidateValueCallback validateValueCallback, bool readOnly) { _Name = name; _PropertyType = propertyType; _OwnerType = ownerType; _DefaultMetadata = typeMetadata; _ValidateValueCallback = validateValueCallback; _ReadOnly = readOnly; }
/// <summary> Registers a read-only view model property. /// </summary> /// <param name="name">The name of the property.</param> /// <param name="propertyType">Type of the property.</param> /// <param name="ownerType">Type of the owner.</param> /// <param name="typeMetadata">The type metadata.</param> /// <param name="validateValueCallback">The validate value callback.</param> /// <returns></returns> /// <remarks></remarks> public static ViewModelPropertyKey RegisterReadOnly(string name, Type propertyType, Type ownerType, ViewModelMetadata typeMetadata, ValidateValueCallback validateValueCallback) { var property = new ModelProperty(name, propertyType, ownerType, typeMetadata, validateValueCallback, true); var key = new ViewModelPropertyKey(property); PropertyCache.Register(property); return(key); }
/// <summary> Registers a read-only view model property. /// </summary> /// <param name="name">The name of the property.</param> /// <param name="propertyType">Type of the property.</param> /// <param name="ownerType">Type of the owner.</param> /// <param name="typeMetadata">The type metadata.</param> /// <returns></returns> /// <remarks></remarks> public static ViewModelPropertyKey RegisterReadOnly(string name, Type propertyType, Type ownerType, ViewModelMetadata typeMetadata) { return(RegisterReadOnly(name, propertyType, ownerType, typeMetadata, null)); }
/// <summary> Registers a view model property. /// </summary> /// <param name="name">The name.</param> /// <param name="propertyType">Type of the property.</param> /// <param name="ownerType">Type of the owner.</param> /// <param name="typeMetadata">The type metadata.</param> /// <param name="validateValueCallback">The validate value callback.</param> /// <returns></returns> /// <remarks></remarks> public static ViewModelProperty Register(string name, Type propertyType, Type ownerType, ViewModelMetadata typeMetadata, ValidateValueCallback validateValueCallback) { var property = new ModelProperty(name, propertyType, ownerType, typeMetadata, validateValueCallback, false); PropertyCache.Register(property); return(property); }
/// <summary> Initializes a new instance of the <see cref="ViewModelProperty.RuntimeProperty"/> class. /// </summary> /// <param name="name">The String containing the name of the property.</param> /// <param name="propertyType">Type of the property.</param> /// <param name="ownerType">The owner type that is registering the property.</param> /// <param name="typeMetadata">Property metadata for the property.</param> /// <param name="validateValueCallback">A reference to a callback that should perform any custom validation of the dependency property value beyond typical type validation.</param> /// <param name="readOnly"></param> internal RuntimeProperty(string name, Type propertyType, Type ownerType, ViewModelMetadata typeMetadata, ValidateValueCallback validateValueCallback, bool readOnly) : base(name, propertyType, ownerType, typeMetadata, validateValueCallback, readOnly) { _PropertyInfo = GetProperty(name, ownerType); }
internal ModelProperty(string name, Type propertyType, Type ownerType, ViewModelMetadata typeMetadata, ValidateValueCallback validateValueCallback, bool readOnly) : base(name, propertyType, ownerType, typeMetadata, validateValueCallback, readOnly) { }
public ViewModelProperty AddOwner(Type ownerType, ViewModelMetadata typeMetadata) { throw new NotImplementedException("{035AB271-7899-4FB0-B3BD-AA99425E7995}"); }