Skip to content

Commit

Permalink
refactor to use LINQ
Browse files Browse the repository at this point in the history
  • Loading branch information
pictos committed Feb 13, 2024
1 parent 77aa468 commit de4c229
Showing 1 changed file with 1 addition and 17 deletions.
18 changes: 1 addition & 17 deletions src/Core/src/Platform/Windows/MauiPasswordTextBox.cs
Original file line number Diff line number Diff line change
Expand Up @@ -75,23 +75,7 @@ static void OnInputScopePropertyChanged(DependencyObject sender, DependencyPrope
return;
}

var isPassword = false;

foreach (var scope in mauiTxtBox.InputScope?.Names ?? [])
{
if (scope.NameValue == InputScopeNameValue.Password)
{
isPassword = true;
break;
}

if (isPassword)
{
isPassword = false;
}
}

mauiTxtBox.IsPassword = isPassword;
mauiTxtBox.IsPassword = mauiTxtBox.InputScope?.Names?.Any(x => x.NameValue == InputScopeNameValue.Password) ?? false;
}

public bool IsPassword
Expand Down

0 comments on commit de4c229

Please sign in to comment.