From c8f447251e4b55a4556da5d57bb242d862cf4c64 Mon Sep 17 00:00:00 2001 From: TheXamlGuy Date: Tue, 11 Jun 2024 22:32:14 +0100 Subject: [PATCH] WIP: Item counts --- Toolkit.Foundation/Count.cs | 10 ++++++++++ Toolkit.Foundation/CountEventArgs.cs | 3 +++ Toolkit.Foundation/QueryEventArgs.cs | 2 +- Toolkit.UI.Controls.Avalonia/InfoBadge/InfoBadge.cs | 8 ++++++++ 4 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 Toolkit.Foundation/Count.cs create mode 100644 Toolkit.Foundation/CountEventArgs.cs create mode 100644 Toolkit.UI.Controls.Avalonia/InfoBadge/InfoBadge.cs diff --git a/Toolkit.Foundation/Count.cs b/Toolkit.Foundation/Count.cs new file mode 100644 index 0000000..9563a8d --- /dev/null +++ b/Toolkit.Foundation/Count.cs @@ -0,0 +1,10 @@ +namespace Toolkit.Foundation; + +public record Count +{ + public static CountEventArgs As(TSender sender) => + new(sender); + + public static CountEventArgs As() where TSender : new() => + new(new TSender()); +} \ No newline at end of file diff --git a/Toolkit.Foundation/CountEventArgs.cs b/Toolkit.Foundation/CountEventArgs.cs new file mode 100644 index 0000000..b222c5f --- /dev/null +++ b/Toolkit.Foundation/CountEventArgs.cs @@ -0,0 +1,3 @@ +namespace Toolkit.Foundation; + +public record CountEventArgs(TSender Sender); \ No newline at end of file diff --git a/Toolkit.Foundation/QueryEventArgs.cs b/Toolkit.Foundation/QueryEventArgs.cs index 91a3852..feea16c 100644 --- a/Toolkit.Foundation/QueryEventArgs.cs +++ b/Toolkit.Foundation/QueryEventArgs.cs @@ -1,3 +1,3 @@ namespace Toolkit.Foundation; -public record QueryEventArgs(TValue Value); \ No newline at end of file +public record QueryEventArgs(TSender Sender); \ No newline at end of file diff --git a/Toolkit.UI.Controls.Avalonia/InfoBadge/InfoBadge.cs b/Toolkit.UI.Controls.Avalonia/InfoBadge/InfoBadge.cs new file mode 100644 index 0000000..2d185e5 --- /dev/null +++ b/Toolkit.UI.Controls.Avalonia/InfoBadge/InfoBadge.cs @@ -0,0 +1,8 @@ +namespace Toolkit.UI.Controls.Avalonia; + +public class InfoBadge : + FluentAvalonia.UI.Controls.InfoBadge +{ + protected override Type StyleKeyOverride => + typeof(FluentAvalonia.UI.Controls.InfoBadge); +} \ No newline at end of file