WPF Rethought for functional (F#) development. Based on ideas from different (Web UI frameworks!) communities - Om, Elm, Cycle.js.

Features:

  1. Unidirectional data flow based on Reactive Extensions - no two ways bindings, no commands bindings. All UI events in component are presented as event stream observed by View Provider, UI observes events stream for data updates.
  2. Global application state - state of whole application is persisted as one object. Such solution has multiple advantages over traditional solutions: only ONE mutable variable in whole program (list containing history of states), free undo/redo / history, free background saving, possibility of serialization of applications state ( restoring state, moving state between application instances, time traveling debugging, etc. ?), single point of mutation ( logging, performance measurements etc. ?), using functional data model.
  3. Cursors - cursors are mechanism providing (UI) component access to only this part of application state component is interested in (so component A doesn't randomly update state of component B etc.) Components are created using Aether's lenses. Components gets access to function returning part of state lens is pointing out, function updating this part of state and stream of changes of this part of state.
  4. View Provider - Abstraction layer representing component. Configured using plain F# record (ViewIntent) - it defines Cursor, UI "output" event stream, and update function invoked on each event in event stream. ViewProvider also give access to "input" event stream - representing changes in this part of model that cursor is pointing at. ViewProvider automatically sets DataContext of View, subscribe Update function to merged event stream from ViewIntent and ensures that subscriptions are disposed when it's unloaded.
  5. Components - they are implemented by inhariting from ViewProvider class, providing ViewIntent, and providing observable streams (based on "input" model stream) for UI layer. Example implementation - https://github.com/Krzysztof-Cieslak/WPF-Rethought/blob/master/WPF_Rethought/Views.fs#L13-L25
  6. ReactiveBinding - XAML markup extension allowing for binding Dependency Properties to IObservable<_> - no INotifyPropertyChanged, no mutable state in code behind.