Table of Contents

Namespace SodaFlow.Bindable.ObjectModel

Classes

BindableCoreExtensionMethods

The constructions of each bindable, for the factories of the two language surfaces. Each implementation is a private nested type. Thus, the public surface is the four interfaces only.

BindableFactory

The default IBindableFactory. It holds one scheduler and gives that scheduler to each object that it creates. Thus, a view model can take the factory through its constructor, and a test can supply Immediate without a copy of the true scheduler.

BindingScheduler

The schedulers that this package gives.

ImmediateBindingScheduler

Runs all work on the calling thread. Use this in a unit test, where a notification must be visible immediately and there is no UI thread.

SynchronizationContextBindingScheduler

Posts through a captured SynchronizationContext. This works with no change for WPF, which uses DispatcherSynchronizationContext, and for Avalonia, which uses AvaloniaSynchronizationContext. The SynchronizationContext must run items one at a time and not in parallel. Its Post() method must not run the SendOrPostCallback delegate directly, because that makes this scheduler re-entrant.

Interfaces

IBindable

An object that this library gives to a view. Each bindable owns a subscription into the FRP graph and a caller must dispose it. This lets a view model keep all of them in one collection.

IBindableAction

An ICommand that supplies its calls as a stream. A Cell<T> of bool controls when the command is available.

IBindableAction<T>

An ICommand that moves its CommandParameter to the stream. A Cell<T> of bool controls when the command is available.

IBindableFactory

Factory methods that give you a bindable. A caller can supply an IBindingScheduler through the constructor, thus a test can replace it.

IBindingScheduler

Moves notifications to the thread that the binding engine needs.

IOneWayBindableValue<T>

A value that a XAML binding engine can read but cannot write. A value starts in the FRP graph and moves out to the view. The view cannot write to it.

IOneWayToSourceBindableValue<T>

A sink for a OneWayToSource binding, which a caller can write but cannot read. The view sends values in and the FRP graph uses them. This interface does not implement INotifyPropertyChanged, because no value moves back out to the view.

IReadableBindableValue<T>

The part of a bindable value that a caller can read, in each direction of flow.

ITwoWayBindableValue<T>

A value that the view can read and also write. A write goes into the FRP graph, and the graph always supplies the value that is the authority.

IWritableBindableValue<T>

A bindable value that the view can write to. This interface gives an ability and not a direction. ITwoWayBindableValue<T> and IOneWayToSourceBindableValue<T> the two supply it. Thus, a method that only sends a value into the graph can accept each one.