Class ObservableProperty
- Namespace
- CarinaStudio.ViewModels
- Assembly
- CarinaStudio.AppBase.Application.dll
Represent an observable property.
public abstract class ObservableProperty
- Inheritance
-
ObservableProperty
- Derived
- Inherited Members
- Extension Methods
Fields
Comparer
Default IComparer<T> for ObservableProperty.
public static readonly IComparer<ObservableProperty> Comparer
Field Value
Properties
Id
Unique ID of property.
public int Id { get; }
Property Value
Name
Name of property.
public string Name { get; }
Property Value
OwnerType
Type of property owner.
public Type OwnerType { get; }
Property Value
ValueType
Type of value.
public Type ValueType { get; }
Property Value
Methods
GetHashCode()
Get hash-code.
public override int GetHashCode()
Returns
- int
Hash-code.
Register<TOwner, TValue>(string, TValue, Func<TOwner, TValue, TValue>?, Predicate<TValue>?)
Register a typed property.
public static ObservableProperty<TValue> Register<TOwner, TValue>(string name, TValue defaultValue = default, Func<TOwner, TValue, TValue>? coerce = null, Predicate<TValue>? validate = null)
Parameters
namestringName of property.
defaultValueTValueDefault value.
coerceFunc<TOwner, TValue, TValue>Coercion function.
validatePredicate<TValue>Validation function.
Returns
- ObservableProperty<TValue>
Type Parameters
TOwnerType of owner.
TValueType of value.