Browse Source

Update Control.cs

Updated the setter for Name to use IsNullOrWhiteSpace to both protect against null and do the emptiness check
pull/1225/head
brandonhood 8 years ago
committed by GitHub
parent
commit
ac9a8d74b8
  1. 4
      src/Avalonia.Controls/Control.cs

4
src/Avalonia.Controls/Control.cs

@ -175,9 +175,9 @@ namespace Avalonia.Controls
set
{
if (value.Trim() == string.Empty)
if (String.IsNullOrWhiteSpace(value))
{
throw new InvalidOperationException("Cannot set Name to empty string.");
throw new InvalidOperationException("Cannot set Name to null or empty string.");
}
if (_styled)

Loading…
Cancel
Save