Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Cannot apply [NotifyDataErrorInfo] to fields that don't have any validation attributes to use during validation.
The following sample generates MVVMTK0026:
using System.ComponentModel.DataAnnotations;
using CommunityToolkit.Mvvm.ComponentModel;
namespace MyApp;
public partial class SampleViewModel : ObservableValidator
{
// This property is requesting validation but has no validation attributes
[ObservableProperty]
[NotifyDataErrorInfo]
private string name;
}
Additional resources
- You can find more examples in the unit tests.
Collaborate with us on GitHub
The source for this content can be found on GitHub, where you can also create and review issues and pull requests. For more information, see our contributor guide.
MVVM Toolkit