feat: ultimate refactoring to separate default dialog and custom dialog.

This commit is contained in:
rabbitism
2024-01-25 00:50:27 +08:00
parent a17f1076d0
commit 430dccc958
16 changed files with 605 additions and 255 deletions

View File

@@ -0,0 +1,23 @@
using Avalonia.Controls;
using Avalonia.Interactivity;
namespace Ursa.Common;
internal static class EventHelper
{
public static void RegisterClickEvent(EventHandler<RoutedEventArgs> handler, params Button?[] buttons)
{
foreach (var button in buttons)
{
if(button is not null) button.Click += handler;
}
}
public static void UnregisterClickEvent(EventHandler<RoutedEventArgs> handler, params Button?[] buttons)
{
foreach (var button in buttons)
{
if(button is not null) button.Click -= handler;
}
}
}