-
Notifications
You must be signed in to change notification settings - Fork 351
Description
In the Introduction to the MVVM Toolkit Microsoft Learn article (version from January 12, 2023 retrieved on May 12, 2023), it is stated that
This package targets .NET Standard so it can be used on any app platform: UWP, WinForms, WPF, Xamarin, Uno, and more; and on any runtime: .NET Native, .NET Core, .NET Framework, or Mono. It runs on all of them.
which seems to indicate that this Community Toolkit should work in an application using WPF that targets .NET Framework 4.8.
If this is the case, then I believe there is a bug present in the version 8.2.0 NuGet package.
The issue is that the code for an ObservableProperty
of an ObservableObject
(such as in the example in the ObservablePropertyAttribute Class documentation) does not get generated when building a WPF application that targets .NET Framework 4.8.
The attached WpfApp1 Visual Studio 2022 Solution is a minimal reproducible example wherein Class1
is an ObservableObject
with an ObservableProperty
and the App.OnStartup
method attempts to use the Class1.Name
property that is supposed to be generated.
Attempting to Build Solution yields
error CS1061: 'Class1' does not contain a definition for 'Name' and no accessible extension method 'Name' accepting a first argument of type 'Class1' could be found (are you missing a using directive or an assembly reference?)
and is preventing my utilization of this feature.