ClientEvents with strongly typed EventArgs<T> for clients events. #5184
Unanswered
markdav-is
asked this question in
Ideas
Replies: 1 comment 1 reply
-
@markdav-is the current dynamic Properties approach was modeled after a similar approach which exists in other Microsoft UI frameworks (ie. WPF, Silverlight, etc...) which is a well-known developer pattern (sometimes referred to as a PropertyBag). |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
We've been using SiteState.Properties.PropertyChanged for intra-module communication with success. As we lean more into messaging between modules the boilerplate and dynamic (loosely typed) objects started to feel fragile. Because we have multiple modules in the same repo, we could share code and created a ClientEvent class (attached). that allows for strongly typed experience.
Let's look at an example:
Publisher Example
Subscriber Example
I know it's not much different, but it does avoid the casting from Dynamic, so it's type-safe.
ClientEvents.cs.txt
Beta Was this translation helpful? Give feedback.
All reactions