using System; namespace AvaloniaValidationSample; public class Item { public int Id { get; set; } private string _Password { get; set; } public string Password { get => _Password; set { validatePassword(value); _Password = value; } } public string Text { get; set; } private void validatePassword(string password) { if (password.Length < 3) { throw new ArgumentException(nameof(password), "Password length > 7 symbols"); } } }