feat: Add PinBox control, styles and demo.
This commit is contained in:
1 parent
c48a634220
commit
aa32f72563
6 files changed
+551
No files matched your search
@@ -0,0 +1,29 @@
|
||||
using Avalonia.Interactivity;
|
||||
using HandyControl.Controls;
|
||||
using System;
|
||||
using System.Reflection;
|
||||
|
||||
namespace HandyControlDemo.UserControl;
|
||||
|
||||
public partial class PinBoxDemo : Avalonia.Controls.UserControl
|
||||
{
|
||||
public PinBoxDemo()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void PinBox_OnCompleted(object? sender, RoutedEventArgs e)
|
||||
{
|
||||
if (e.Source is PinBox pinBox)
|
||||
{
|
||||
TryShowGrowl(pinBox.Password);
|
||||
}
|
||||
}
|
||||
|
||||
private static void TryShowGrowl(string message)
|
||||
{
|
||||
var growlType = Type.GetType("HandyControl.Controls.Growl, HandyControl");
|
||||
var infoMethod = growlType?.GetMethod("Info", BindingFlags.Public | BindingFlags.Static, [typeof(string), typeof(string)]);
|
||||
infoMethod?.Invoke(null, [message, string.Empty]);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user