ViewModel:
public class MyViewModel { [Required, StringLength(50)] public String SomeProperty { ... } }
XAML:
Or you can have your model only to accept a max # chars:
private string _MyText { get; set; } public string MyText { get => _MyText; set => _MyText = value?.Substring(0, Math.Min(value.Length, 15)); } Text="{Binding Path=MyText}"