System.NotSupportedException when executing ObservableList.Add #91
Open
Description
Issue: When executing ObservableList.Add
, a System.NotSupportedException
is thrown with the message: 'The send method is not supported, use Post instead.' This issue does not occur in version 3.3.0 but appears in version 3.3.1.
Code to reproduce:
public ObservableList<string> Collection2 { get; } = ["Item 0", "Item 1"];
public INotifyCollectionChangedSynchronizedViewList<string> Collection { get; }
public ReactiveCommand<Unit> AddCommand { get; } = new();
public R3ViewModel()
{
this.AddCommand.Subscribe(_ =>
{
this.Collection2.Add($"Item {this.Collection}");
});
this.Collection = this.Collection2.CreateView(x => x).ToNotifyCollectionChanged(SynchronizationContextCollectionEventDispatcher.Current);
}
Steps to reproduce:
- Execute
this.AddCommand
in the provided code. - Observe the
System.NotSupportedException
being thrown.
Expected behavior: The command should execute without throwing an exception, as it does in version v3.3.0.
Actual behavior: The exceptionSystem.NotSupportedException: 'The send method is not supported, use Post instead.'
is thrown in version v3.3.1.
Could you please let me know if there is a fix or workaround available for this issue? Thank you.
Environment:
• WinUI3
• TargetFramework: net8.0-windows10.0.19041.0
Metadata
Assignees
Labels
No labels