- Add NotifyPropertyChanged for the HasErrors property.
- Add TwoWayT bindings for workflows that reuse bindings.
- Add OneWayToSeqT bindings.
- Add vopt and opt bindings for OneWayT, OneWayToSourceT, and TwoWayT bindings.
- Add .NET 8 target and remove .NET Core 3.1 support
- Added the Readme file to the generated nuspec file so that it shows up on nuget.org.
- Added some debug logs to the performance logger at the top level.
- Brought up new functions to parity with the performance logger.
- Corrected the threaded dispatch case when an immediate UI update was needed. Done by adding an unschedule
Dispatcher
job at the same priority as the other scheduler jobs, which will force it to run in the correct order before any of the execute update jobs arrive to the queue, thus preventing any of the old scheduler jobs from getting executed after this immediate UI update. - Added debug logging with counters to represent the increasing sequence of
setUiState
being called and scheduled on other threads (to ensure proper ordering).
- Fixed a bug in the threaded dispatch case that could result in an out-of-date model being updated.
- Skip intermediate updates to view model when they queue up in the threaded case.
- Reverted the following change from beta-51 because Set caching is problematic:
- Notify Property Changed directly on Set rather than waiting around for the next update. Set value is now cached until the next time update/dispatch is called.
- Allow skipping intermediate updates when they pile up on UI Thread.
- Notify Property Changed directly on Set rather than waiting around for the next update. Set value is now cached until the next time update/dispatch is called.
- Upgraded to Elmish v4
- BREAKING: Changed syntax of
WpfProgram.withSubscription
to now take named list ofSubscribe<'msg> = Dispatch<'msg> -> IDisposable
(note theIDisposable
return). This function now gets called every time'model
updates (previously it was only called on startup). This allows starting and stopping of subscriptions from this function by the given string list identifier. - BREAKING: Changed
Sub<'msg>
toEffect<'msg>
everywhere (Effect<'msg> = Dispatch<'msg> -> unit
, see difference withSubscribe<'msg>
above). Also renames helper functions. This does not breakCmd<'msg>
s that didn't name theSub<'msg>
type (or helpers). - Added
WpfProgram.withTermination
to allow conditional exit of the elmish loop on a specific'msg
, as well as specify a side effect on exit.
- BREAKING: Changed syntax of
- Added more documentation throughout the helpers.
- Updated some of the sample projects for clarity.
- Added
Binding.SubModelT.seq
that allows aseq
of static sub models that are all properly updated when there is a dispatch.
- Added ability to run elmish update loop on a background thread rather than only on the main UI thread.
- Added a
Threading
sample project demonstrating above feature.
- Improved
ViewModelBase
to infer view model property types from the Model getter rather than needing to be explicitly specified. - Added
't
type parameter toBinding<'model, 'msg, 't>
everywhere to support above feature.Binding<'model, 'msg>
is defined asBinding<'model, 'msg, obj>
for full backwards compatibility. - Added
Binding.boxT
andBinding.unboxT
to support moving back and forth between the two. - Added
Binding.OneWayT
,Binding.OneWayToSourceT
andBinding.CmdT
modules for creating strongly typed primitives for the top feature. - Added types internally to carry everything through (mostly provably) correctly.
- Added
'viewModel
type parameter toWpfProgram<'model, 'msg, 'viewModel>
to support using a static view model at the top level.WpfProgram<'model, 'msg>
is defined asWpfProgram<'model, 'msg, obj>
for full backwards compatibility. Also madeWpfProgram
core type more generic, replacing the list of bindings with equivalent but more flexibleCreateViewModel
andUpdateViewModel
functions. - Added
WpfProgram.mkSimpleT
,WpfProgram.mkProgramT
andWpfProgram.mkProgramWithCmdMsgT
for making programs that use static view models as the top-level data context. - Modified
SubModelStatic
sample project to use new static view model features.
- Added
ViewModelBase
which allows view models to be defined as static types with real properties rather than unnamed dynamic types with stringly named properties. - Added
Binding.SubModelT
,Binding.SubModelSeqUnkeyedT
,Binding.SubModelSeqKeyedT
andBinding.SubModelWinT
modules for creating these static types as sub models. - Replaced internal usage of refs in dynamic view model with get/set functions to allow for matting of the type.
- Added some internal types to support
ViewModelBase
. - Improved documentation.
- Added a
SubModelStatic
sample project using above feature.
- Improved performance of Lazy effect by reducing calls to later model mappings
- Removed
SourceOrTarget
andDuplicateIdException
from public API (added in4.0.0-beta-42
) - Improved caching effect to not invalidating the cache too early (an issue introduced in version
3.5.3
via PR 181) - Renamed
Binding.SetMsgWithModel
toBinding.setMsgWithModel
(breaking public API added in4.0.0-beta-42
) - Fixed bug with
mapMsgWithModel
andsetMsgWithModel
where the original model was sometimes given (an issue introduced in4.0.0-beta-42
) - Replaced framework targets
net461
andnet5.0-windows
withnet480
andnet6.0-windows
respectively. - Updated minimum
FSharp.Core
version to6.0.5
. - Updated minimum
Microsoft.Extensions.Logging.Abstractions
version to6.0.1
. - Fixed broken log statement called when a
SubModelSelectedItem
binding can't find an item in aSubModelSeq
binding.
- Fixed sticky effect that was broken in
4.0.0-beta-42
- Added
WpfProgram.withElmishErrorHandler
- Improved debugging experience by overriding
GetDynamicMemberNames
- Relaxed version constrains on
FSharp.Core
andMicrosoft.Extensions.Logging.Abstractions
- Improved API of
WindowState<_>
- Dropped support for .NET Core 3.0. Still have support for .NET Core 3.1.
- Added
setMsg
in theBinding
module - Added
setMsgWithModel
in theBinding
module - Removed
id
in theBinding
module (that was added in 4.0.0-beta-3) - Lazy effect now exposed via the name
addLazy
- Validation effect now exposed via the name
addValidation
- Sticky effect now exposed via the name
addSticky
- Added caching effect via the name
addCaching
- Now logging when WPF tries to get or set a binding and an exception is thrown
- Added to the
SubModelSeq
method API an overload that only takes bindings - Added support for a
SubModelSeq
variant that does involve IDs SubModelSeq
variant that involves IDs will now merge elements without considering IDs if duplicate IDs are detected- Fixed bug (present in 3.5.8) where
ArgumentNullException
is thrown fromINotifyDataErrorInfo.GetErrors
when givennull
- Now logging and returning
false
to WPF if selection in aSubModelSelectedItem
binding fails - Added prebuilt bindings for
Selector.SelectedIndex
- Added
Binding.TwoWay.id
to API - Removed trace logging during a successful set in a
SubModelSelectedItem
binding - Added one-way-to-source binding
- Added function-based API for for one-way bindings
- Added composable monomorphic dispatch wrapping
- Switched the order of inputs in the function given to
Binding.mapMsgWithModel
. This is breaking for public API introduced in 4.0.0-beta-1. - Added
alterMsgStream
to API. This feature is a replacement for what was previously calledwrapDispatch
.
- Fixed "backwards typing" (#373) and other bugs (like #371) introduced in 4.0.0-beta-40 with more careful use of the Dispatcher (#374)
- Removed recently added trace logging of INotifyDataErrorInfo.HasErrors (#354)
- Fixed typos in documentation and logging (#357)
- Fixed race condition with Dispatcher (#359)
- Removed overload of
ViewModel<_,_>.ToString
because of slow performance (#370)
- Added support for composable binding stickiness
sticky
- Added support for composable binding validation
withValidation
- Added support for composable binding laziness via
lazy'
- Improved logging
- Changed CurrentModel and UpdateModel on ViewModel<,> from public to internal
runWindow
now shows the given window after settings itsDataContext
. This removes the need to haveVisibility
values default toCollapsed
.- Changed minimum Elmish version from 3.0.3 to 3.1.0 (which is currently the latest). Commands created with
OfAsync
are now executed on a threadpool thread. For example, it is now easier to show file dialogs without blocking the Elmish dispatch loop. See this diff.
- Added logging when INotifyDataErrorInfo.HasErrors is called
- Fixed bug in INotifyDataErrorInfo.HasErrors where
true
always returned aftertrue
first correctly returned
- Breaking: Removed the obsolete binding functions in the
BindingFn
module - Breaking: Removed the obsolete function
Elmish.WPF.Cmd.showWindow
- Breaking: Removed all occurrences of the argument
wrapDispatch
from the methods used to create a binding. There is currently no migration path. Please create an issue if this is a negative impact for you. - Breaking: App initialization is now done using the
WpfProgram
module instead of theProgram
module - Breaking: Removed
ElmConfig
. For controlling logging, see below. For specifying a binding performance log threshold (corresponding to the oldElmConfig.MeasureLimitMs
field), useWpfProgram.withBindingPerformanceLogThreshold
- Breaking: The method
Binding.oneWaySeq
is implemented by calling the methodBinding.oneWaySeqLazy
withequals
=refEq
andmap
=id
. This is a breaking change when using a mutable data structure for the sequence. Compensate by directly callingBinding.oneWaySeqLazy
withequals
=fun _ _ = false
. - Breaking: Some calls to
Binding
methods now include an equality constraint. This only is only breaking if the corresponding type included theNoEquality
attribute. - Added binding mapping functions
- Added
mapModel
,mapMsg
, andmapMsgWithModel
in both theBinding
andBindings
modules - These functions enable common model and message mapping logic to be extracted
- See the
SubModelSeq
sample for an excellent use ofmapModel
andmapMsg
- Added
- Improved logging:
- Now uses
Microsoft.Extensions.Logging
for wide compatibility and easy integration into common log frameworks - Use
WpfProgram.WithLogger
to pass anILoggerFactory
for your chosen log framework - Can control specific log categories
- See the samples for a demonstration using Serilog
- Now uses
- Removed overload of
ViewModel<_,_>.ToString
because of slow performance (#370)
- Excluded 4.* prereleases from possibilities for version of Elmish dependency
- Added support for multiple validation errors
- Added target
net5.0-windows
ViewModel<'model, 'msg>
now overridesobject.ToString()
and returns a string representation of the current'model
instance. This is only intended for debugging. No guarantees are given about the exact structure of the returned string.- Fixed incorrect spelling of a word in a log message
- The amount of time used to update
OneWaySeq
andSubModelSeq
bindings has been significantly decreased. This includes all cases of aSubModelSeq
binding and all cases of aOneWaySeq
binding for whichequals
returnsfalse
.
- Fix exception when showing sub-windows as part of
init
- Windows may now be created on any thread
- Fix crash when
init
returns a command opening asubModelWin
- Improved error handling when collection bindings contain duplicates
- Improve performance of
Binding.oneWaySeq
,Binding.oneWaySeqLazy
, andBinding.subModelSeq
- Add
netcoreapp3.0
target
- Corrected type parameter of
getId
inoneWaySeqLazy
- Make model/dispatch available to
getWindow
inBinding.subModelWin
- Added optional dispatch wrapper to two-way bindings and command bindings, which allows dispatches to be throttled/debounced etc.
- Fixed
ElmConfig.MeasureLimitMs
not being used
- Added proper dialog/window support using
Binding.subModelWin
. See the readme for more and the NewWindow sample for an example. - Deprecated
Cmd.showWindow
(useBinding.subModelWin
instead)
- Added
Program.withDebugTrace
which is similar towithConsoleTrace
but writes usingSystem.Diagnostics.Debug.WriteLine
(e.g. to the VS output window)
- The most massive (and hopefully useful) update yet!
- Breaking: Overload-based syntax for
Binding
. The oldBinding
module is deprecated and renamed toBindingFn
. The newBinding
is a static class with static methods, providing many overloads for flexibility. To migrate, replace all occurrences ofBinding.
withBindingFn.
and follow the deprecation warnings. - Breaking: The
Elmish.WPF.Internal
namespace has been removed and everything in it that should actually be internal has been markedinternal
. This includesViewModel
. - Breaking:
Elmish.WPF.Internal.BindingSpec<_,_>
has been moved/renamed toElmish.WPF.Binding<_,_>
. It should thus be more pleasant to use in type annotations. - Breaking:
Elmish.WPF.Utilities.ViewModel.designInstance
has been moved toElmish.WPF.ViewModel
. Furthermore, it returnsobj
sinceViewModel
is internal. - Breaking: Removed
twoWayIfValid
. It hasn’t worked for a while due to core Elmish internals, and was of suspect utility anyway. - New: Many more helpful
Binding
signatures available due to the new overload-based syntax. - New: More general
Binding.subModel
andBinding.subModelSeq
overloads that allow a more idiomatic Elm architecture even with static views. For background information, see #86 (the issue is otherwise outdated). - New: Sticky
subModelOpt
bindings that returns the last non-null model when model isNone
(useful when animating out stuff) - New:
elmEq
andrefEq
as useful equality defaults for lazy bindings.elmEq
efficiently uses reflection to do a comparison for each member that is referential for reference types except strings, and structural for strings and value types. - New:
Program.mkSimpleWpf
andProgram.mkProgramWpf
with more WPF-friendly signatures. - New:
Program.mkProgramWpfWithCmdMsg
for easily following theCmdMsg
pattern to allow testable commands. See the FAQ in the readme for details. - New:
Cmd.showWindow
helper to open a new window. - New: Slow calls can be logged (configurable threshold).
- New: Made available
Program.startElmishLoop
which is a low-level function that starts an Elmish loop given an ElmishProgram
and a WPFFrameworkElement
. You probably won’t need it. - Improvement: Logs now indicate the binding path.
- Improvement: Possibly better performance due to internals now using
ValueOption
instead ofOption
. - Improvement: Finally added (lots of) unit tests, so confidence of correct functionality is higher. (No critical bugs were found when creating the tests.)
- No changes, but updated for Elmish 3.0 so the package can finally move out of beta
- Add Binding.subModelSelectedItem
- Fix checkboxes erroneously being shown as failing validation (#78) by @BillHally
- The above fix also fixes binding warnings for two-way bindings
- Add new bindings
oneWayOpt
andtwoWayOpt
(#75) - Update to Elmish 3.0.0-beta-7
- Add new binding
subBindingSeq
, see readme for details.
- Fix Elmish dependency version in nuget spec
- Update to Elmish 3
- Dispatch on UI thread to block instead of getting weird UI behaviour from race conditions when updates take too long
- Fix
subModelSeq
items being unselected during updates
- Breaking: Change order of
oneWayLazyWith
arguments to and rename it tooneWayLazy
, removing the existingoneWayLazy
function. The rationale is explained in #60 . To migrate from 2.0.0-beta-3 to 2.0.0-beta-4: Add(=)
as theequals
parameter tooneWayLazy
usages, and renameoneWayLazyWith
usages tooneWayLazy
. - Add
Binding.oneWaySeqLazy
- Add convenience function to create design-time VMs
- Improve log messages
- Complete rewrite, several breaking changes and new features
twoWayValidation
is calledtwoWayIfValid
(because that’s what it is, and it clearly separates it from the newtwoWayValidate
)oneWayMap
is calledoneWayLazy
(its implementation has changed, and the use case has expanded, but is similar)cmd
andcmdIf
have been renamedparamCmd
andparamCmdIf
, because the old names have new signatures/use-casesmodel
has been renamedsubModel
because it’s more clear, and consistent with the newsubModelOpt
andsubModelSeq
Program.runDebugWindow
has been removed in favour ofProgram.runWindowWithConfig
- Bundled Elmish has been removed, and Elmish 2.0 is used as an external dependency
- Any
Application
instance instantiated before callingProgram.run...
will now be used - Several new functions in the
Binding
module; dot into it in your IDE or see the repository for samples or source code
- Fix for #19, model to view updates for validation bindings
- Implemented INotifyDataErrorInfo and corresponding bindings
- Added some documentation for binding assemblers
- Added message box error handler to Program module
- Target F# 4.1
- Latest fable-elmish, includes memory leak fix
- Added Program.withExceptionHandler
- Fixing nuget framework version
- Added command parameter
- Renamed Binding.vm to Binding.model
- Reorganized samples and added performance sample (WIP)
- Fixing two way binding bugs
- Elmish all the WPF!