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, IPropertyModel, IDataModel, IDisposable
- Inheritance:
- object ObservableObjectBase DataModelBase object
- Derived:
- CachedPropertyModelBase
- Implements:
- IPropertyModel IDataModel IDisposable
Constructors
PropertyModelBase()
Initializes an instance of the class.
protected PropertyModelBase()
Properties
AddChildCommand
The ICommand used to add a new child into to an associated collection/parent.
CanAddChild
Indicates whether a new child can be added to an associated collection/parent.
public abstract bool CanAddChild { get; }
Property Value
- bool:
trueif a new child can be added to an associated collection/parent; otherwise,false.
CanAddChildResolved
The resolved value for whether a new child can be added to an associated collection/parent.
[Obsolete("Use the CanAddChild property instead.")]
[Browsable(false)]
protected bool CanAddChildResolved { get; }
Property Value
CanRemove
Indicates whether the property can be removed from an associated collection/parent.
public abstract bool CanRemove { get; }
Property Value
- bool:
trueif the property can be removed from an associated collection/parent; otherwise,false.
CanRemoveResolved
The resolved value for whether the property can be removed from an associated collection/parent.
[Obsolete("Use the CanRemove property instead.")]
[Browsable(false)]
protected bool CanRemoveResolved { get; }
Property Value
CanResetValue
Indicates whether the property can be reset to its default value.
public abstract bool CanResetValue { get; }
Property Value
- bool:
trueif the property can be reset to its default value; otherwise,false.
CanResetValueResolved
The resolved value for whether the property can be reset to its default value.
[Obsolete("Use the CanResetValue property instead.")]
[Browsable(false)]
protected bool CanResetValueResolved { get; }
Property Value
Category
Gets a category for the property.
Converter
The TypeConverter to use for the property.
ConverterResolved
The resolved TypeConverter to use for the property.
[Obsolete("Use the Converter property instead.")]
[Browsable(false)]
protected TypeConverter? ConverterResolved { get; }
Property Value
HasStandardValues
Indicates whether the property supports StandardValues.
public virtual bool HasStandardValues { get; }
Property Value
- bool:
trueif the property supports StandardValues; otherwise,false.
IsHostReadOnly
Indicates whether the host UI control (e.g., a property grid) is read-only.
public bool IsHostReadOnly { get; set; }
Property Value
- bool:
trueif the host UI control (e.g., a property grid) is read-only; otherwise,false.
IsImmutable
Indicates whether the Value's child properties, if any, are capable of being edited.
public abstract bool IsImmutable { get; }
Property Value
IsImmutableResolved
The resolved value for whether the Value's child properties, if any, are capable of being edited.
[Obsolete("Use the IsImmutable property instead.")]
[Browsable(false)]
protected bool IsImmutableResolved { get; }
Property Value
IsLimitedToStandardValues
Indicates whether the Value property can only be set to one of the values defined by the StandardValues property.
public abstract bool IsLimitedToStandardValues { get; }
Property Value
- bool:
trueif the Value property can only be set to one of the values defined by the StandardValues property; otherwise,false.
IsMergeable
Indicates whether the property can be merged when presenting multiple objects.
public abstract bool IsMergeable { get; }
Property Value
- bool:
trueif the property can be merged when presenting multiple objects; otherwise,false.
IsReadOnly
Indicates whether UI for editing the property value is read-only.
public bool IsReadOnly { get; }
Property Value
- bool:
trueif the UI for editing the property value is read-only; otherwise,false.
Remarks
This property is a resolved value of IsHostReadOnly and IsValueReadOnly.
IsValueReadOnly
Indicates whether the Value property is read-only.
public abstract bool IsValueReadOnly { get; set; }
Property Value
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.
IsValueReadOnlyResolved
The resolved value for whether the Value property is read-only.
[Obsolete("Use the IsValueReadOnly property instead.")]
[Browsable(false)]
protected bool IsValueReadOnlyResolved { get; }
Property Value
NamePropertyEditor
The PropertyEditor, if any, that was used to select the DataTemplate for showing the property display name.
NameTemplate
The DataTemplate to use for showing the property display name.
public abstract DataTemplate? NameTemplate { get; }
Property Value
Remarks
The priority order of value template specification is NameTemplate, NameTemplateSelector, NameTemplateKey, and finally any name templates in matching property editors.
NameTemplateKey
The resource key that references a DataTemplate to use for showing the property display name.
public abstract object? NameTemplateKey { get; }
Property Value
Remarks
The priority order of value template specification is NameTemplate, NameTemplateSelector, NameTemplateKey, and finally any name templates in matching property editors.
NameTemplateSelector
The DataTemplateSelector to use for showing the property display name.
public abstract DataTemplateSelector? NameTemplateSelector { get; }
Property Value
Remarks
The priority order of value template specification is NameTemplate, NameTemplateSelector, NameTemplateKey, and finally any name templates in matching property editors.
RemoveCommand
The ICommand used to remove the property from an associated collection/parent.
ResetValueCommand
The ICommand used to reset the property value to its default value.
ShouldNotifyParentOnValueChange
Indicates whether the property should notify its parent property when the Value changes.
public abstract bool ShouldNotifyParentOnValueChange { get; }
Property Value
ShouldNotifyParentOnValueChangeResolved
The resolved value for whether the property should notify its parent property when the value changes.
[Obsolete("Use the ShouldNotifyParentOnValueChange property instead.")]
[Browsable(false)]
protected bool ShouldNotifyParentOnValueChangeResolved { get; }
Property Value
StandardValues
The standard list of values for the Value property.
StandardValuesAsStrings
The standard list of values for the ValueAsString property as a list of strings.
public abstract IEnumerable<string>? StandardValuesAsStrings { get; }
Property Value
StandardValuesDisplayMemberPath
The display member path for StandardValues when IsLimitedToStandardValues is true.
StandardValuesResolved
The resolved standard list of values for the Value property.
[Obsolete("Use the StandardValues property instead.")]
[Browsable(false)]
protected IEnumerable? StandardValuesResolved { get; }
Property Value
StandardValuesSelectedValuePath
The selected value path for StandardValues when IsLimitedToStandardValues is true.
Target
The target object that owns the property.
TargetResolved
The resolved target object that owns the property.
[Obsolete("Use the Target property instead.")]
[Browsable(false)]
protected object? TargetResolved { get; }
Property Value
TargetType
Value
The property value.
ValueAsString
The property value in a string representation.
ValuePropertyEditor
The PropertyEditor, if any, that was used to select the DataTemplate for editing the property value.
ValueResolved
The resolved property value.
[Obsolete("Use the Value property instead.")]
[Browsable(false)]
protected object? ValueResolved { get; set; }
Property Value
ValueTemplate
The DataTemplate to use for editing the property value.
public abstract DataTemplate? ValueTemplate { get; }
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
The resource key that references a DataTemplate to use for editing the property value.
public abstract object? ValueTemplateKey { get; }
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
The DefaultValueTemplateKind that specifies a default value cell template to use for editing the property value.
public abstract DefaultValueTemplateKind ValueTemplateKind { get; }
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
The DataTemplateSelector to use for editing the property value.
public abstract DataTemplateSelector? ValueTemplateSelector { get; }
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
ValueTypeResolved
The resolved Type of the Value property.
[Obsolete("Use the ValueType property instead.")]
[Browsable(false)]
protected Type? ValueTypeResolved { get; }
Property Value
Values
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.
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
- bool:
trueif 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 |
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 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 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 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 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 event data. |
RaisePropertyValueChangedEvent(PropertyModelValueChangeEventArgs)
Raises a property value changed event on the PropertyGrid.
protected void RaisePropertyValueChangedEvent(PropertyModelValueChangeEventArgs e)
| Parameter | Type | Description |
|---|---|---|
| e | PropertyModelValueChangeEventArgs | The |
RaisePropertyValueChangingEvent(PropertyModelValueChangeEventArgs)
Raises a property value changing event on the PropertyGrid.
protected void RaisePropertyValueChangingEvent(PropertyModelValueChangeEventArgs e)
| Parameter | Type | Description |
|---|---|---|
| e | PropertyModelValueChangeEventArgs | The |
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
- DataModelBase.Dispose()
- DataModelBase.Dispose(bool)
- DataModelBase.RefreshChildren()
- DataModelBase.ToString()
- DataModelBase.CanAutoDispose
- DataModelBase.Children
- DataModelBase.DescriptionResolved
- DataModelBase.DisplayNameResolved
- DataModelBase.IsExpanded
- DataModelBase.IsModifiedResolved
- DataModelBase.IsRoot
- DataModelBase.IsSelected
- DataModelBase.NameResolved
- DataModelBase.Parent
- DataModelBase.SortComparer
- DataModelBase.SortImportanceResolved
- DataModelBase.SortOrderResolved
- DataModelBase.Tag
- ObservableObjectBase.NotifyPropertyChanged(string)
- ObservableObjectBase.OnPropertyChanged(string)
- ObservableObjectBase.OnPropertyChanging(string)
- ObservableObjectBase.OnPropertyChanging(PropertyChangingEventArgs)
- ObservableObjectBase.SetProperty<T>(ref T, T, string)
- ObservableObjectBase.PropertyChanged
- ObservableObjectBase.PropertyChanging
- object.GetType()
- object.MemberwiseClone()
- object.Equals(object)
- object.Equals(object, object)
- object.ReferenceEquals(object, object)
- object.GetHashCode()