In This Article

PropertyModelBase Class

Provides an abstract base class for a property grid IDataModel that can provide the foundation for an IPropertyModel implementation.

public abstract class PropertyModelBase : DataModelBase, INotifyPropertyChanged, IDataModel, IDisposable, IDataErrorInfo
Inheritance:
Object ObservableObjectBase DataModelBase Object
Derived:
CachedPropertyModelBase
Implements:
IDataModel IDisposable

Constructors

PropertyModelBase()

protected PropertyModelBase()

Properties

AddChildCommand

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

public ICommand AddChildCommand { get; }

Property Value

ICommand:

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

CanAddChildResolved

Gets the resolved value for whether a new child can be added to an associated collection/parent.

protected abstract bool CanAddChildResolved { get; }

Property Value

Boolean:

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

CanRemoveResolved

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

protected abstract bool CanRemoveResolved { get; }

Property Value

Boolean:

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

CanResetValueResolved

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

protected abstract bool CanResetValueResolved { get; }

Property Value

Boolean:

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

ConverterResolved

Gets the resolved TypeConverter to use for the property.

protected abstract TypeConverter ConverterResolved { get; }

Property Value

TypeConverter:

The TypeConverter to use for the property.

HasStandardValues

Gets whether the property supports StandardValues.

public virtual bool HasStandardValues { get; }

Property Value

Boolean:

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.

public bool IsHostReadOnly { get; set; }

Property Value

Boolean:

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

IsImmutableResolved

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

protected abstract bool IsImmutableResolved { get; }

Property Value

Boolean:

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

IsReadOnly

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

public bool IsReadOnly { get; }

Property Value

Boolean:

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, and also considers whether a parent property is immutable.

IsValueReadOnlyResolved

Gets the resolved value for whether the Value property is read-only.

protected abstract bool IsValueReadOnlyResolved { get; }

Property Value

Boolean:

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

NamePropertyEditor

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

public PropertyEditor NamePropertyEditor { get; set; }

Property Value

PropertyEditor:

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

RemoveCommand

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

public 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.

public ICommand ResetValueCommand { get; }

Property Value

ICommand:

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

ShouldNotifyParentOnValueChangeResolved

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

protected abstract bool ShouldNotifyParentOnValueChangeResolved { get; }

Property Value

Boolean:

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

StandardValuesDisplayMemberPath

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

public string StandardValuesDisplayMemberPath { get; set; }

Property Value

String:

The display member path for StandardValues when IsLimitedToStandardValues is true.

StandardValuesResolved

Gets the resolved standard list of values for the Value property.

protected abstract IEnumerable StandardValuesResolved { get; }

Property Value

IEnumerable:

The standard list of values for the Value property.

StandardValuesSelectedValuePath

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

public string StandardValuesSelectedValuePath { get; set; }

Property Value

String:

The selected value path for StandardValues when IsLimitedToStandardValues is true.

TargetResolved

Gets the resolved target object that owns the property.

protected abstract object TargetResolved { get; }

Property Value

Object:

The target object that owns the property.

ValuePropertyEditor

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

public PropertyEditor ValuePropertyEditor { get; set; }

Property Value

PropertyEditor:

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

ValueResolved

Gets or sets the resolved property value.

protected abstract object ValueResolved { get; set; }

Property Value

Object:

The property value.

ValueTypeResolved

Gets the resolved Type of the Value property.

protected abstract Type ValueTypeResolved { get; }

Property Value

Type:

The Type of the Value property.

Methods

AddChild()

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

public virtual void AddChild()

ConvertFromString(String)

Converts the specified value from a string.

protected virtual object ConvertFromString(string stringValue)
Parameter Type Description
stringValue String

The string value to convert.

Returns

Object:

An object from the string representation, or null.

ConvertToString(Object)

Converts the specified value to a string.

protected virtual string ConvertToString(object value)
Parameter Type Description
value Object

The value to convert.

Returns

String:

A string representation of the specified value, or null.

CycleToNextStandardValue()

Cycles the property value to the next standard value.

public virtual bool CycleToNextStandardValue()

Returns

Boolean:

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

GetErrorMessages(String)

Returns the error messages for the target object or one of its properties.

protected virtual IEnumerable GetErrorMessages(string columnName)
Parameter Type Description
columnName String

The name of the property to examine, or null if the target object itself should be examined.

Returns

IEnumerable:

The error messages that are applicable, if any.

OnPropertyChanged(PropertyChangedEventArgs)

Raises the PropertyChanged event.

protected override void OnPropertyChanged(PropertyChangedEventArgs e)
Parameter Type Description
e PropertyChangedEventArgs

The PropertyChangedEventArgs that contains the event data.

RaiseChildPropertyAddedEvent(PropertyModelChildChangeEventArgs)

Raises a collection item property added event on the PropertyGrid.

protected void RaiseChildPropertyAddedEvent(PropertyModelChildChangeEventArgs e)
Parameter Type Description
e PropertyModelChildChangeEventArgs

The PropertyModelChildChangeEventArgs that contains the event data.

RaiseChildPropertyAddingEvent(PropertyModelChildChangeEventArgs)

Raises a collection item property adding event on the PropertyGrid.

protected void RaiseChildPropertyAddingEvent(PropertyModelChildChangeEventArgs e)
Parameter Type Description
e PropertyModelChildChangeEventArgs

The PropertyModelChildChangeEventArgs that contains the event data.

RaiseChildPropertyRemovedEvent(PropertyModelChildChangeEventArgs)

Raises a collection item property removed event on the PropertyGrid.

protected void RaiseChildPropertyRemovedEvent(PropertyModelChildChangeEventArgs e)
Parameter Type Description
e PropertyModelChildChangeEventArgs

The PropertyModelChildChangeEventArgs that contains the event data.

RaiseChildPropertyRemovingEvent(PropertyModelChildChangeEventArgs)

Raises a collection item property removing event on the PropertyGrid.

protected void RaiseChildPropertyRemovingEvent(PropertyModelChildChangeEventArgs e)
Parameter Type Description
e PropertyModelChildChangeEventArgs

The PropertyModelChildChangeEventArgs that contains the event data.

RaisePropertyValueChangedEvent(PropertyModelValueChangeEventArgs)

Raises a property value changed event on the PropertyGrid.

protected void RaisePropertyValueChangedEvent(PropertyModelValueChangeEventArgs e)
Parameter Type Description
e PropertyModelValueChangeEventArgs

The PropertyModelValueChangeEventArgs that contains the event data.

RaisePropertyValueChangingEvent(PropertyModelValueChangeEventArgs)

Raises a property value changing event on the PropertyGrid.

protected void RaisePropertyValueChangingEvent(PropertyModelValueChangeEventArgs e)
Parameter Type Description
e PropertyModelValueChangeEventArgs

The PropertyModelValueChangeEventArgs that contains the event data.

Refresh(PropertyRefreshReason)

Refreshes the property based on the specified reason.

public virtual 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.

public virtual void Remove()

ResetValue()

Resets the property value to its default value.

public virtual void ResetValue()

Inherited Members