DataModelBase Class
Provides an abstract base class for a property grid IDataModel.
public abstract class DataModelBase : ObservableObjectBase, INotifyPropertyChanged, IDataModel, IDisposable
- Inheritance:
- Object ObservableObjectBase Object
- Implements:
- IDataModel IDisposable
Constructors
DataModelBase()
protected DataModelBase()
Properties
CanAutoDispose
Gets whether the data model should be automatically disposed when it is removed from a parent data model.
public virtual bool CanAutoDispose { get; }
Property Value
- Boolean:
true
if the data model should be automatically disposed when it is removed from a parent data model; otherwise,false
.
Children
Gets the collection of child data models.
public DataModelCollection Children { get; }
Property Value
- DataModelCollection:
The collection of child data models.
DescriptionResolved
Gets the resolved description of the data model, often displayed in a summary area or a tooltip.
protected abstract string DescriptionResolved { get; }
Property Value
- String:
The resolved description of the data model, often displayed in a summary area or a tooltip.
DisplayNameResolved
Gets the name to use when displaying the data model, often the same as Name
.
protected abstract string DisplayNameResolved { get; }
Property Value
- String:
The name to use when displaying the data model, often the same as
Name
.
IsExpanded
Gets or sets whether the data model is expanded.
public bool IsExpanded { get; set; }
Property Value
- Boolean:
true
if the data model is expanded; otherwise,false
.
IsModifiedResolved
Gets whether the data model has been modified.
protected abstract bool IsModifiedResolved { get; }
Property Value
- Boolean:
true
if the data model has been modified; otherwise,false
.
IsRoot
Gets whether the data model is the root.
public virtual bool IsRoot { get; }
Property Value
- Boolean:
true
if the data model is the root; otherwise,false
.
IsSelected
Gets or sets whether the data model is selected.
public bool IsSelected { get; set; }
Property Value
- Boolean:
true
if the data model is selected; otherwise,false
.
NameResolved
Gets the resolved name of the data model.
protected abstract string NameResolved { get; }
Property Value
- String:
The resolved name of the data model.
Parent
Gets the parent data model.
SortComparer
Gets or sets the DataModelSortComparer to use for sorting this data model's children.
public DataModelSortComparer SortComparer { get; set; }
Property Value
- DataModelSortComparer:
The DataModelSortComparer to use for sorting this data model's children.
Remarks
If this property doesn't return anything, the default SortComparer will be used.
SortImportanceResolved
Gets a resolved DataModelSortImportance that indicates the sort importance of this data model.
protected abstract DataModelSortImportance SortImportanceResolved { get; }
Property Value
- DataModelSortImportance:
A DataModelSortImportance that indicates the sort importance of this data model.
SortOrderResolved
Gets a resolved numeric sort order for sorting the data model within other data models of the same sort importance.
protected abstract int SortOrderResolved { get; }
Property Value
- Int32:
A numeric sort order for sorting the data model within other data models of the same sort importance.
Tag
Gets or sets custom data for the data model.
Methods
Dispose()
Releases all resources used by the object.
public void Dispose()
Dispose(Boolean)
Releases the unmanaged resources used by the object and optionally releases the managed resources.
protected virtual void Dispose(bool disposing)
Parameter | Type | Description |
---|---|---|
disposing | Boolean |
|
Remarks
This method is called by the public Dispose
method and the Finalize
method.
Dispose
invokes this method with the disposing
parameter set to true
.
Finalize
invokes this method with disposing
set to false
.
Finalize()
Allows an object to attempt to free resources and perform other cleanup operations before the object is reclaimed by garbage collection.
protected void Finalize()
RefreshChildren()
Refreshes the contents of the Children property.
protected virtual void RefreshChildren()
ToString()
Returns a String representation of this instance.
Explicit Interface Implementations
IDataModel.Description
Gets the description of the data model, often displayed in a summary area or a tooltip.
string IDataModel.Description { get; }
Returns
- String:
The description of the data model, often displayed in a summary area or a tooltip.
IDataModel.DisplayName
Gets the name to use when displaying the data model, often the same as Name
.
string IDataModel.DisplayName { get; }
Returns
- String:
The name to use when displaying the data model, often the same as
Name
.
IDataModel.IsInitialized
Gets or sets whether the data model has been initialized.
bool IDataModel.IsInitialized { get; set; }
Returns
- Boolean:
true
if the data model has been initialized; otherwise,false
.
IDataModel.IsModified
Gets whether the data model has been modified.
bool IDataModel.IsModified { get; }
Returns
- Boolean:
true
if the data model has been modified; otherwise,false
.
IDataModel.Name
Gets the name of the data model.
IDataModel.Parent
Gets or sets the parent data model.
IDataModel.SortImportance
Gets a DataModelSortImportance that indicates the sort importance of this data model.
DataModelSortImportance IDataModel.SortImportance { get; }
Returns
- DataModelSortImportance:
A DataModelSortImportance that indicates the sort importance of this data model.
IDataModel.SortOrder
Gets a numeric sort order for sorting the data model within other data models of the same sort importance.
int IDataModel.SortOrder { get; }
Returns
- Int32:
A numeric sort order for sorting the data model within other data models of the same sort importance.
Inherited Members
- ObservableObjectBase.NotifyPropertyChanged(String)
- ObservableObjectBase.OnPropertyChanged(PropertyChangedEventArgs)
- ObservableObjectBase.PropertyChanged
- Object.Equals(Object)
- Object.Equals(Object, Object)
- Object.ReferenceEquals(Object, Object)
- Object.GetHashCode()
- Object.GetType()
- Object.MemberwiseClone()