add readonly password reveal
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
using Avalonia.Data.Converters;
|
||||
using Avalonia.Markup.Xaml;
|
||||
using System.Globalization;
|
||||
|
||||
namespace Toolkit.UI.Avalonia;
|
||||
|
||||
public class BooleanToPasswordCharConverter :
|
||||
MarkupExtension,
|
||||
IValueConverter
|
||||
{
|
||||
public override object ProvideValue(IServiceProvider serviceProvider) =>
|
||||
this;
|
||||
|
||||
public char PasswordChar { get; set; }
|
||||
|
||||
public object? Convert(object? value, Type targetType, object? parameter, CultureInfo culture) =>
|
||||
value is bool boolValue ? boolValue ? '\0' : PasswordChar : (object)PasswordChar;
|
||||
|
||||
public object? ConvertBack(object? value, Type targetType, object? parameter, CultureInfo culture) =>
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
@@ -70,6 +70,7 @@
|
||||
<controls:SettingsExpanderItem
|
||||
Name="ContentHost"
|
||||
Padding="{DynamicResource SettingsExpanderPadding}"
|
||||
Action="{TemplateBinding Action}"
|
||||
ActionIconSource="{TemplateBinding ActionIconSource}"
|
||||
ActionTemplate="{TemplateBinding ActionTemplate}"
|
||||
Background="Transparent"
|
||||
@@ -152,7 +153,6 @@
|
||||
Grid.Column="2"
|
||||
Content="{TemplateBinding Action}"
|
||||
ContentTemplate="{TemplateBinding ActionTemplate}" />
|
||||
<Button Grid.Column="2">dsfdsfsdfs</Button>
|
||||
<Viewbox
|
||||
Name="ActionIconHost"
|
||||
Grid.Column="3"
|
||||
|
||||
Reference in New Issue
Block a user