From 0aaa236cadde359e8c2eb576ebf701c5cf073843 Mon Sep 17 00:00:00 2001 From: Dan Clark Date: Fri, 29 Nov 2024 21:22:18 +0000 Subject: [PATCH] Add first event with a key value --- Toolkit.Foundation/Activate.cs | 4 ++++ Toolkit.Foundation/ActivateEventArgs.cs | 15 +++++++++++++++ 2 files changed, 19 insertions(+) diff --git a/Toolkit.Foundation/Activate.cs b/Toolkit.Foundation/Activate.cs index 870a837..f1ec74b 100644 --- a/Toolkit.Foundation/Activate.cs +++ b/Toolkit.Foundation/Activate.cs @@ -5,4 +5,8 @@ public record Activate public static ActivateEventArgs As(TValue value) => new(value); public static ActivateEventArgs As() where TValue : new() => new(new TValue()); + + public static ActivateEventArgs As(TValue value) => new(value); + + public static ActivateEventArgs As() where TValue : new() => new(new TValue()); } diff --git a/Toolkit.Foundation/ActivateEventArgs.cs b/Toolkit.Foundation/ActivateEventArgs.cs index 3ffe8e2..af58f68 100644 --- a/Toolkit.Foundation/ActivateEventArgs.cs +++ b/Toolkit.Foundation/ActivateEventArgs.cs @@ -12,5 +12,20 @@ public record ActivateEventArgs public ActivateEventArgs() { + } +} + +public record ActivateEventArgs +{ + public TValue? Value { get; } + + public ActivateEventArgs(TValue value) + { + Value = value; + } + + public ActivateEventArgs() + { + } } \ No newline at end of file