CommunityToolkit / dotnet

.NET Community Toolkit is a collection of helpers and APIs that work for all .NET developers and are agnostic of any specific UI platform. The toolkit is maintained and published by Microsoft, and part of the .NET Foundation.
https://docs.microsoft.com/dotnet/communitytoolkit/?WT.mc_id=dotnet-0000-bramin
Other
3.07k stars 299 forks source link

The RequestMessage in Constructor #604

Open Hakoyu opened 1 year ago

Hakoyu commented 1 year ago

Describe the bug

If the RequestMessage is used in the constructor, the xaml design view will not be displayed correctly. image

Regression

No response

Steps to reproduce

class ViewModel : ObservableRecipient
{
    public ViewModel()
    {
        var str = WeakReferenceMessenger.Default.Send<RequestMessage<string>>();
    }
}

Expected behavior

The design view is displayed normally

Screenshots

No response

IDE and version

VS 2022

IDE version

17.4.4

Nuget packages

Nuget package version(s)

8.1.0

Additional context

No response

Help us help you

Yes, I'd like to be assigned to work on this item