Skip to content

System.NotSupportedException when executing ObservableList.Add #91

Open
@southernwind

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:

  1. Execute this.AddCommand in the provided code.
  2. 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 exception System.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

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions