Class ObservableValue<T>
Observable value. Can be changed and can be observed.
Inherited Members
Namespace: Cortex.Net.Types
Assembly: Cortex.Net.dll
Syntax
public class ObservableValue<T> : Atom, IAtom, IObservable, IDependencyNode, IObservableValue<T>, IValue<T>, IValue
Type Parameters
Name | Description |
---|---|
T | The type of the Observable value. |
Constructors
| Improve this Doc View SourceObservableValue(ISharedState, String, IEnhancer, T)
Initializes a new instance of the ObservableValue<T> class.
Declaration
public ObservableValue(ISharedState sharedState, string name, IEnhancer enhancer, T value = null)
Parameters
Type | Name | Description |
---|---|---|
ISharedState | sharedState | The shared state this Observable will be attached to. |
System.String | name | The name of this observable value. |
IEnhancer | enhancer | The enhancer to use on the type. |
T | value | The initial value of the Observable. |
Properties
| Improve this Doc View SourceValue
Gets or sets the underlying value.
Declaration
public T Value { get; set; }
Property Value
Type | Description |
---|---|
T |
Methods
| Improve this Doc View SourceObserve(EventHandler<ValueChangedEventArgs<T>>, Boolean)
Registers the secified event handler, and optionally fires it first.
Declaration
public void Observe(EventHandler<ValueChangedEventArgs<T>> changedEventHandler, bool fireImmediately)
Parameters
Type | Name | Description |
---|---|---|
EventHandler<ValueChangedEventArgs<T>> | changedEventHandler | The event handler to register. |
System.Boolean | fireImmediately | Whether to fire the event handler immediately. |
Events
| Improve this Doc View SourceChange
Event that fires before the value will change.
Declaration
public event EventHandler<ValueChangeEventArgs<T>> Change
Event Type
Type | Description |
---|---|
EventHandler<ValueChangeEventArgs<T>> |
Changed
Event that fires after the value has changed.
Declaration
public event EventHandler<ValueChangedEventArgs<T>> Changed
Event Type
Type | Description |
---|---|
EventHandler<ValueChangedEventArgs<T>> |
Explicit Interface Implementations
| Improve this Doc View SourceIValue.Value
Gets or sets the underlying value.
Declaration
object IValue.Value { get; set; }
Returns
Type | Description |
---|---|
System.Object |