Table of Contents

Class ReactivePort<T>

Namespace
FlowGraph.Core.DataFlow
Assembly
FlowGraph.Core.dll

A reactive port that stores a value and notifies when it changes. Thread-safe for UI binding scenarios.

public sealed class ReactivePort<T> : IPortValue<T>, IPortValue, INotifyPropertyChanged

Type Parameters

T

The type of value this port holds.

Inheritance
ReactivePort<T>
Implements
Inherited Members

Constructors

ReactivePort(string, T?)

Creates a new reactive port.

public ReactivePort(string portId, T? initialValue = default)

Parameters

portId string

The port identifier.

initialValue T

The initial value.

Properties

PortId

Gets the port ID this value belongs to.

public string PortId { get; }

Property Value

string

TypedValue

Gets or sets the typed value.

public T? TypedValue { get; set; }

Property Value

T

ValueType

Gets the CLR type of the value.

public Type ValueType { get; }

Property Value

Type

Methods

SetValue(object?)

Sets the value from an untyped object.

public void SetValue(object? value)

Parameters

value object

The value to set. Must be compatible with ValueType.

ToString()

Returns a string that represents the current object.

public override string ToString()

Returns

string

A string that represents the current object.

Events

PropertyChanged

Occurs when a property value changes.

public event PropertyChangedEventHandler? PropertyChanged

Event Type

PropertyChangedEventHandler

TypedValueChanged

Event raised when the value changes with typed arguments.

public event EventHandler<PortValueChangedEventArgs<T>>? TypedValueChanged

Event Type

EventHandler<PortValueChangedEventArgs<T>>

ValueChanged

Event raised when the value changes (non-generic).

public event EventHandler<PortValueChangedEventArgs>? ValueChanged

Event Type

EventHandler<PortValueChangedEventArgs>

Operators

implicit operator T?(ReactivePort<T>)

Implicitly converts a ReactivePort to its value.

public static implicit operator T?(ReactivePort<T> port)

Parameters

port ReactivePort<T>

Returns

T