fixes a null ref
This commit is contained in:
parent
5ec55ac0ce
commit
32601d164a
1 changed files with 2 additions and 2 deletions
|
|
@ -26,8 +26,8 @@ namespace BookAStar.Behaviors
|
|||
|
||||
private void bindable_TextChanged(object sender, TextChangedEventArgs e)
|
||||
{
|
||||
IsValid = e.NewTextValue.Length <= 0 || e.NewTextValue.Length <= MaxLength;
|
||||
if (!IsValid && e.NewTextValue.Length > MaxLength)
|
||||
IsValid = e.NewTextValue == null? false : ( e.NewTextValue.Length > 0 && e.NewTextValue.Length <= MaxLength ) ;
|
||||
if (!IsValid) if (e.NewTextValue!=null) if (e.NewTextValue.Length > MaxLength)
|
||||
((Editor)sender).Text = e.NewTextValue.Substring(0, MaxLength);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue