In This Article

DataModelBase Class

Provides an abstract base class for a property grid IDataModel.

public abstract class DataModelBase : ObservableObjectBase, IDataModel, IDisposable
Inheritance:
object ObservableObjectBase object
Derived:
CategoryEditorModel CategoryModel PropertyModelBase
Implements:
IDataModel IDisposable

Constructors

DataModelBase()

Initializes an instance of the class.

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

bool:

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

bool:

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

bool:

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

bool:

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

bool:

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.

public IDataModel Parent { get; }

Property Value

IDataModel:

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

int:

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.

public object Tag { get; set; }

Property Value

object:

The custom data for the data model.

Methods

Dispose()

Releases all resources used by the object.

public void Dispose()

Dispose(bool)

Releases the unmanaged resources used by the object and optionally releases the managed resources.

protected virtual void Dispose(bool disposing)
Parameter Type Description
disposing bool

true to release both managed and unmanaged resources; false to release only unmanaged resources.

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.

~DataModelBase()

Allows an object to attempt to free resources and perform other cleanup operations before the object is reclaimed by garbage collection.

protected ~DataModelBase()

RefreshChildren()

Refreshes the contents of the Children property.

protected virtual void RefreshChildren()

ToString()

Returns a string representation of this instance.

public override string ToString()

Returns

string:

A string representation of this instance.

Inherited Members