Skip to content

ReactiveElmish.Avalonia v1.1.1

Latest
Compare
Choose a tag to compare
@JordanMarr JordanMarr released this 28 Jan 20:51
· 29 commits to main since this release

This release adds new methods to the ReactiveElmishViewModel that provide the ability to bind regular list and Map<> properties from your model to your view model without having to directly use DynamicData SourceList and SourceCache collections in your model.
These methods will diff changes in your model and then update the view on your behalf.

BindList

Binds a collection type on the model to a DynamicData.SourceList behind the scenes. Changes to the collection in the model are diffed and updated for you in the SourceList. Also has an optional map overload that allows you to transform items when they are added to the SourceList.

BindKeyedList

Binds a Map<'Key, 'Value> "keyed list" to an ObservableCollection behind the scenes. Changes to the Map in the model are diffed based on the provided getKey function that returns the 'Key for each item. Use this when you want to store a list of items that can be identified by one or more identifying keys. Also has a map overload that allows you to transform items when they are added to the ObservableCollection.

BindSourceCache

Added a new optional parameter, update, which allows you to pass a function to manually update the mapped item when the item changes in the model.

See also: Tips for Binding Collections