In This Article

IDataModel Interface

Provides the requirements for a data model class that can represent a property or category in a property grid.

public interface IDataModel : IDisposable

Properties

CanAutoDispose

Indicates whether the data model should be automatically disposed when it is removed from a parent data model.

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

The collection of child data models.

DataModelCollection Children { get; }

Property Value

DataModelCollection

Description

The description of the data model, often displayed in a summary area or a tooltip.

string? Description { get; }

Property Value

string

DisplayName

The name to use when displaying the data model, often the same as Name.

string? DisplayName { get; }

Property Value

string

IsExpanded

Indicates whether the data model is expanded.

bool IsExpanded { get; set; }

Property Value

bool:

true if the data model is expanded; otherwise, false.

IsInitialized

Indicates whether the data model has been initialized.

bool IsInitialized { get; set; }

Property Value

bool:

true if the data model has been initialized; otherwise, false.

IsModified

Indicates whether the data model has been modified.

bool IsModified { get; }

Property Value

bool:

true if the data model has been modified; otherwise, false.

IsRoot

Indicates whether the data model is the root.

bool IsRoot { get; }

Property Value

bool:

true if the data model is the root; otherwise, false.

IsSelected

Indicates whether the data model is selected.

bool IsSelected { get; set; }

Property Value

bool:

true if the data model is selected; otherwise, false.

Name

The name of the data model.

string? Name { get; }

Property Value

string

Parent

The parent data model.

IDataModel? Parent { get; set; }

Property Value

IDataModel

Remarks

Do not set this property directly, as it will be set when a data model is added as a child of another data model.

SortComparer

The DataModelSortComparer to use for sorting this data model's children.

DataModelSortComparer? SortComparer { get; set; }

Property Value

DataModelSortComparer

Remarks

If this property doesn't return anything, the default SortComparer will be used.

SortImportance

A DataModelSortImportance that indicates the sort importance of this data model.

DataModelSortImportance SortImportance { get; }

Property Value

DataModelSortImportance

SortOrder

A numeric sort order for sorting the data model within other data models of the same sort importance.

int SortOrder { get; }

Property Value

int

Tag

Custom data for the data model.

object? Tag { get; set; }

Property Value

object

Inherited Members

Extension Methods