At the moment we can bind a control property to IObservable<T> using the ^ operator.
It would be nice enhancement to be able to bind ItemsControl.Items (etc) to DynamicData observables such asIObservableList<T> and IObservable<IChangeSet<T>> using the same operator.
class MyViewModel
{
public IObservableList<MyItem> MyItems { get ;}
}
<ItemsControl Items="{Binding MyItems^}"/>
One benefit would be that the ViewModel doesn't need to create and maintain a ReadOnlyObservableCollection<T> when the view binds directly to IObservableList<T>; the collection will never be created if the View never instantiates the control.
IObservableList
I think you already have an indirect dependency on it as ReactiveUI v10.3.6 depends on DynamicData v6.13.9
Avalonia works perfectly fine without ReactiveUI and has no direct dependency as you stated. The binding system is part of the core of Avalonia. This feature should be optional.
My mistake, it's only used in the Avalonia.ReactiveUI.
Perhaps someday a DynamicData Binding markup extension could be added to that assembly.
I think we need a prototype that uses DynamicData in a sortable, groupable "ItemsControl". The control itself would need direct access to IObservableList etc
It should be possible to extend the binding system with a stream plugin:
For reference:
Most helpful comment
It should be possible to extend the binding system with a stream plugin:
For reference:
IStreamPluginObservableStreamPlugin(implementation forIObservable)