diff --git a/Runtime/Messaging/Messages/BaseTagMessage.cs b/Runtime/Messaging/Messages/BaseTagMessage.cs new file mode 100644 index 0000000..1ca820c --- /dev/null +++ b/Runtime/Messaging/Messages/BaseTagMessage.cs @@ -0,0 +1,9 @@ +namespace MVVMToolkit.Messaging +{ + public abstract class BaseTagMessage where TType : new() + { + private static readonly TType Instance = new(); + + public static TType Message() => Instance; + } +} \ No newline at end of file diff --git a/Runtime/Messaging/Messages/BaseTagMessage.cs.meta b/Runtime/Messaging/Messages/BaseTagMessage.cs.meta new file mode 100644 index 0000000..05a2bce --- /dev/null +++ b/Runtime/Messaging/Messages/BaseTagMessage.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: e4017233c664409ebd3b72aeaadcf99e +timeCreated: 1680970609 \ No newline at end of file diff --git a/Runtime/Messaging/Messages/BaseValueMessage.cs b/Runtime/Messaging/Messages/BaseValueMessage.cs new file mode 100644 index 0000000..cb3bf6d --- /dev/null +++ b/Runtime/Messaging/Messages/BaseValueMessage.cs @@ -0,0 +1,7 @@ +namespace MVVMToolkit.Messaging +{ + public abstract class BaseValueMessage + { + public TValue value; + } +} \ No newline at end of file diff --git a/Runtime/Messaging/Messages/BaseValueMessage.cs.meta b/Runtime/Messaging/Messages/BaseValueMessage.cs.meta new file mode 100644 index 0000000..49de06f --- /dev/null +++ b/Runtime/Messaging/Messages/BaseValueMessage.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: f9a1ca26ee15452586f47d1a65c1b09d +timeCreated: 1680970612 \ No newline at end of file diff --git a/Runtime/Messaging/Messages/CloseViewsMessage.cs b/Runtime/Messaging/Messages/CloseViewsMessage.cs index 4e2908e..ac0fe4e 100644 --- a/Runtime/Messaging/Messages/CloseViewsMessage.cs +++ b/Runtime/Messaging/Messages/CloseViewsMessage.cs @@ -1,4 +1,4 @@ namespace MVVMToolkit.Messaging { - public class CloseViewsMessage { } + public class CloseViewsMessage : BaseTagMessage { } } \ No newline at end of file diff --git a/Runtime/Messaging/Messages/ValueMessage.cs b/Runtime/Messaging/Messages/ValueMessage.cs new file mode 100644 index 0000000..ef5cd83 --- /dev/null +++ b/Runtime/Messaging/Messages/ValueMessage.cs @@ -0,0 +1,14 @@ +namespace MVVMToolkit.Messaging +{ + public abstract class ValueMessage : BaseValueMessage + where TType : BaseValueMessage, new() + { + private static readonly TType Instance = new(); + + public static TType Message(TValue value) + { + Instance.value = value; + return Instance; + } + } +} \ No newline at end of file diff --git a/Runtime/Messaging/Messages/ValueMessage.cs.meta b/Runtime/Messaging/Messages/ValueMessage.cs.meta new file mode 100644 index 0000000..1cbcbe4 --- /dev/null +++ b/Runtime/Messaging/Messages/ValueMessage.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 8b7920626d6e41e7be982f325c06ecb3 +timeCreated: 1680970418 \ No newline at end of file