48 lines
1.0 KiB
C#
48 lines
1.0 KiB
C#
using Microsoft.AspNetCore.Components;
|
|
|
|
namespace EgwCoreLib.Razor
|
|
{
|
|
public partial class PasswordBox
|
|
{
|
|
#region Public Properties
|
|
|
|
[Parameter]
|
|
public bool DisableShow { get; set; } = false;
|
|
|
|
[Parameter]
|
|
public string ItemLabel { get; set; } = "";
|
|
|
|
[Parameter]
|
|
public string Password { get; set; } = "p4ssw@rD!";
|
|
|
|
[Parameter]
|
|
public EventCallback<string> PasswordChanged { get; set; }
|
|
|
|
#endregion Public Properties
|
|
|
|
#region Protected Methods
|
|
|
|
protected void toggleShow()
|
|
{
|
|
showPassword = !showPassword;
|
|
}
|
|
|
|
#endregion Protected Methods
|
|
|
|
#region Private Fields
|
|
|
|
private bool showPassword;
|
|
|
|
#endregion Private Fields
|
|
|
|
#region Private Methods
|
|
|
|
private Task OnPasswordChanged(ChangeEventArgs e)
|
|
{
|
|
Password = $"{e.Value}";
|
|
return PasswordChanged.InvokeAsync(Password);
|
|
}
|
|
|
|
#endregion Private Methods
|
|
}
|
|
} |