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
|
<controls:SettingsExpanderItem
|
||||||
Name="ContentHost"
|
Name="ContentHost"
|
||||||
Padding="{DynamicResource SettingsExpanderPadding}"
|
Padding="{DynamicResource SettingsExpanderPadding}"
|
||||||
|
Action="{TemplateBinding Action}"
|
||||||
ActionIconSource="{TemplateBinding ActionIconSource}"
|
ActionIconSource="{TemplateBinding ActionIconSource}"
|
||||||
ActionTemplate="{TemplateBinding ActionTemplate}"
|
ActionTemplate="{TemplateBinding ActionTemplate}"
|
||||||
Background="Transparent"
|
Background="Transparent"
|
||||||
@@ -152,7 +153,6 @@
|
|||||||
Grid.Column="2"
|
Grid.Column="2"
|
||||||
Content="{TemplateBinding Action}"
|
Content="{TemplateBinding Action}"
|
||||||
ContentTemplate="{TemplateBinding ActionTemplate}" />
|
ContentTemplate="{TemplateBinding ActionTemplate}" />
|
||||||
<Button Grid.Column="2">dsfdsfsdfs</Button>
|
|
||||||
<Viewbox
|
<Viewbox
|
||||||
Name="ActionIconHost"
|
Name="ActionIconHost"
|
||||||
Grid.Column="3"
|
Grid.Column="3"
|
||||||
|
|||||||
Reference in New Issue
Block a user