We moved all namespaces into a single namespace. No matter which (WinUICommunity) library you use, the namespace is always as follows For use in the Xaml: xmlns:wuc="using:WinUICommunity" For use in the Csharp: using WinUICommunity;
privatestring _name = string.Empty; publicstring Name { get => _name; set { if (_name != value) { _name = value; ValidateName(_name); OnPropertyChanged(); } } }
privatestring _mail = string.Empty; publicstring Mail { get => _mail; set { if (_mail != value) { _mail = value; ValidateMail(_mail); OnPropertyChanged(); } } }
privatevoidValidateName(string name) { var errors = new List<string>(3); if (name.Contains("1", StringComparison.InvariantCulture)) errors.Add("Using Jungkook's favorite number is not allowed.");
if (name.Length == 0) errors.Add("You'll need a name. I will not accept this."); elseif (name.Length > 4) errors.Add("Your name is too long. Make it shorter.");
if (name.Contains("LPK", StringComparison.InvariantCultureIgnoreCase)) errors.Add("Name is forbidden for unknown reasons.");
SetErrors("Name", errors); }
privatevoidValidateMail(string mail) { var errors = new List<string>(2); if (mail.Contains("1", StringComparison.InvariantCulture)) errors.Add("Using Jungkook's favorite number is not allowed.");
if (!mail.Contains("@", StringComparison.InvariantCultureIgnoreCase)) errors.Add("Invalid mail.");
public IEnumerable GetErrors(string propertyName) { if (string.IsNullOrEmpty(propertyName) || !_validationErrors.ContainsKey(propertyName)) returnnull;