In This Article

IPropertyModel Interface

Provides the requirements for a property grid property IDataModel.

public interface IPropertyModel : IDataModel, IDisposable

Properties

AddChildCommand

Gets the ICommand used to add a new child into to an associated collection/parent.

ICommand AddChildCommand { get; }

Property Value

ICommand:

The ICommand used to add a new child into to an associated collection/parent.

CanAddChild

Gets whether a new child can be added to an associated collection/parent.

bool CanAddChild { get; }

Property Value

bool:

true if a new child can be added to an associated collection/parent; otherwise, false.

CanRemove

Gets whether the property can be removed from an associated collection/parent.

bool CanRemove { get; }

Property Value

bool:

true if the property can be removed from an associated collection/parent; otherwise, false.

CanResetValue

Gets whether the property can be reset to its default value.

bool CanResetValue { get; }

Property Value

bool:

true if the property can be reset to its default value; otherwise, false.

Category

Gets a category for the property.

string Category { get; }

Property Value

string:

A category for the property.

Converter

Gets the TypeConverter to use for the property.

TypeConverter Converter { get; }

Property Value

TypeConverter:

The TypeConverter to use for the property.

HasStandardValues

Gets whether the property supports StandardValues.

bool HasStandardValues { get; }

Property Value

bool:

true if the property supports StandardValues; otherwise, false.

IsHostReadOnly

Gets or sets whether the host UI control (e.g. a property grid) is read-only.

bool IsHostReadOnly { get; set; }

Property Value

bool:

true if the host UI control (e.g. a property grid) is read-only; otherwise, false.

IsImmutable

Gets whether the Value's child properties, if any, are capable of being edited.

bool IsImmutable { get; }

Property Value

bool:

true if the Value's child properties, if any, are capable of being edited; otherwise, false.

IsLimitedToStandardValues

Gets whether the Value property can only be set to one of the values defined by the StandardValues property.

bool IsLimitedToStandardValues { get; }

Property Value

bool:

true if the Value property can only be set to one of the values defined by the StandardValues property; otherwise, false.

IsMergeable

Gets whether the property can be merged when presenting multiple objects.

bool IsMergeable { get; }

Property Value

bool:

true if the property can be merged when presenting multiple objects; otherwise, false.

IsReadOnly

Gets whether UI for editing the property value is read-only.

bool IsReadOnly { get; }

Property Value

bool:

true if the UI for editing the property value is read-only; otherwise, false.

Remarks

This property is a resolved value of IsHostReadOnly and IsValueReadOnly.

IsValueReadOnly

Gets or sets whether the Value property is read-only.

bool IsValueReadOnly { get; set; }

Property Value

bool:

true if the Value property is read-only; otherwise, false.

Remarks

This property can be set to true to force a normally-editable property to be read-only. Some implementations of this property will always return true when the underlying property value is unable to be set.

NamePropertyEditor

Gets or sets the PropertyEditor, if any, that was used to select the DataTemplate for showing the property display name.

PropertyEditor NamePropertyEditor { get; set; }

Property Value

PropertyEditor:

The PropertyEditor, if any, that was used to select the DataTemplate for showing the property display name.

NameTemplate

Gets the DataTemplate to use for showing the property display name.

DataTemplate NameTemplate { get; }

Property Value

DataTemplate:

The DataTemplate to use for showing the property display name.

Remarks

The priority order of value template specification is NameTemplate, NameTemplateSelector, NameTemplateKey, and finally any name templates in matching property editors.

NameTemplateKey

Gets the resource key that references a DataTemplate to use for showing the property display name.

object NameTemplateKey { get; }

Property Value

object:

The resource key that references a DataTemplate to use for showing the property display name.

Remarks

The priority order of value template specification is NameTemplate, NameTemplateSelector, NameTemplateKey, and finally any name templates in matching property editors.

NameTemplateSelector

Gets the DataTemplateSelector to use for showing the property display name.

DataTemplateSelector NameTemplateSelector { get; }

Property Value

DataTemplateSelector:

The DataTemplateSelector to use for showing the property display name.

Remarks

The priority order of value template specification is NameTemplate, NameTemplateSelector, NameTemplateKey, and finally any name templates in matching property editors.

RemoveCommand

Gets the ICommand used to remove the property from an associated collection/parent.

ICommand RemoveCommand { get; }

Property Value

ICommand:

The ICommand used to remove the property from an associated collection/parent.

ResetValueCommand

Gets the ICommand used to reset the property value to its default value.

ICommand ResetValueCommand { get; }

Property Value

ICommand:

The ICommand used to reset the property value to its default value.

ShouldNotifyParentOnValueChange

Gets whether the property should notify its parent property when the Value changes.

bool ShouldNotifyParentOnValueChange { get; }

Property Value

bool:

true if the property should notify its parent property when the Value changes; otherwise, false.

StandardValues

Gets the standard list of values for the Value property.

IEnumerable StandardValues { get; }

Property Value

IEnumerable:

The standard list of values for the Value property.

StandardValuesAsStrings

Gets the standard list of values for the ValueAsString property as a list of strings.

IEnumerable<string> StandardValuesAsStrings { get; }

Property Value

IEnumerable<string>:

The standard list of values for the ValueAsString property as a list of strings.

StandardValuesDisplayMemberPath

Gets or sets the display member path for StandardValues when IsLimitedToStandardValues is true.

string StandardValuesDisplayMemberPath { get; set; }

Property Value

string:

The display member path for StandardValues when IsLimitedToStandardValues is true.

StandardValuesSelectedValuePath

Gets or sets the selected value path for StandardValues when IsLimitedToStandardValues is true.

string StandardValuesSelectedValuePath { get; set; }

Property Value

string:

The selected value path for StandardValues when IsLimitedToStandardValues is true.

Target

Gets the target object that owns the property.

object Target { get; }

Property Value

object:

The target object that owns the property.

TargetType

Gets the Type of the Target property.

Type TargetType { get; }

Property Value

Type:

The Type of the Target property.

Value

Gets or sets the property value.

object Value { get; set; }

Property Value

object:

The property value.

ValueAsString

Gets or sets the property value in a string representation.

string ValueAsString { get; set; }

Property Value

string:

The property value in a string representation.

ValuePropertyEditor

Gets or sets the PropertyEditor, if any, that was used to select the DataTemplate for editing the property value.

PropertyEditor ValuePropertyEditor { get; set; }

Property Value

PropertyEditor:

The PropertyEditor, if any, that was used to select the DataTemplate for editing the property value.

ValueTemplate

Gets the DataTemplate to use for editing the property value.

DataTemplate ValueTemplate { get; }

Property Value

DataTemplate:

The DataTemplate to use for editing the property value.

Remarks

The priority order of value template specification is ValueTemplate, ValueTemplateSelector, ValueTemplateKey, ValueTemplateKind, and finally any value templates in matching property editors.

ValueTemplateKey

Gets the resource key that references a DataTemplate to use for editing the property value.

object ValueTemplateKey { get; }

Property Value

object:

The resource key that references a DataTemplate to use for editing the property value.

Remarks

The priority order of value template specification is ValueTemplate, ValueTemplateSelector, ValueTemplateKey, ValueTemplateKind, and finally any value templates in matching property editors.

ValueTemplateKind

Gets the DefaultValueTemplateKind that specifies a default value cell template to use for editing the property value.

DefaultValueTemplateKind ValueTemplateKind { get; }

Property Value

DefaultValueTemplateKind:

The DefaultValueTemplateKind that specifies a default value cell template to use for editing the property value.

Remarks

The priority order of value template specification is ValueTemplate, ValueTemplateSelector, ValueTemplateKey, ValueTemplateKind, and finally any value templates in matching property editors.

ValueTemplateSelector

Gets the DataTemplateSelector to use for editing the property value.

DataTemplateSelector ValueTemplateSelector { get; }

Property Value

DataTemplateSelector:

The DataTemplateSelector to use for editing the property value.

Remarks

The priority order of value template specification is ValueTemplate, ValueTemplateSelector, ValueTemplateKey, ValueTemplateKind, and finally any value templates in matching property editors.

ValueType

Gets the Type of the Value property.

Type ValueType { get; }

Property Value

Type:

The Type of the Value property.

Values

Gets the property values, of which there will only be more than one if this is a merged property.

IList<object> Values { get; }

Property Value

IList<object>:

The property values, of which there will only be more than one if this is a merged property.

Methods

AddChild()

Adds a new child into to an associated collection/parent.

void AddChild()

CycleToNextStandardValue()

Cycles the property value to the next standard value.

bool CycleToNextStandardValue()

Returns

bool:

true if a standard value was set; otherwise, false.

Refresh(PropertyRefreshReason)

Refreshes the property based on the specified reason.

void Refresh(PropertyRefreshReason reason)
Parameter Type Description
reason PropertyRefreshReason

The reason the property needs to be refreshed.

Remove()

Removes the property from an associated collection/parent.

void Remove()

ResetValue()

Resets the property value to its default value.

void ResetValue()

Inherited Members