Browse by Topic
Popular
Popular Posts
Latest
Latest C# Posts
C# Event Null Check: Safe Invocation Patterns
c# event null check: Learn how to safely check and invoke C# events to avoid NullReferenceException, including thread-safe patterns and the null-conditional operator.
Raising Events in C#: Syntax, Safety, and Common Pitfalls
Raising events in C#: declare and invoke them safely, pass custom event arguments, handle no subscribers, and avoid common pitfalls that break production code.
C# Custom EventArgs: Passing Data with Events
c# custom eventargs: Learn how to create custom EventArgs classes in C# to pass structured data with events, including design rules and memory behavior.
C# EventHandler: Events, Subscriptions, and Pitfalls
Learn how to declare, raise, and subscribe to events with C# EventHandler, including custom event args, thread safety, exception isolation, and avoiding memory leaks.
C# Event vs Delegate: Key Differences
C# event vs delegate: Understand the technical difference between C# events and delegates, including invocation rules, assignment restrictions, and when to use each.
How to Unsubscribe from C# Events: Syntax and Memory Leak Prevention
Learn how to use -= to unsubscribe from C# events, avoid memory leaks, and manage event handler lifetimes with practical examples.
C# Event Subscription: Syntax, Pitfalls, and Clean Unsubscription
Learn C# event subscription syntax, why unsubscribing matters, how to avoid memory leaks, and when to use lambda, method group, or weak event patterns.
C# Event Declaration: Syntax, Behavior, and Pitfalls
Learn the syntax for declaring C# events, safe ways to raise them, and the difference between events and delegate fields.
C# Event Usage: Declaring, Raising, and Handling Events
Learn how to declare, raise, and handle events in C# with practical examples, thread-safety considerations, and memory-leak prevention.
C# Discard Lambda Parameter: When and How to Use It
Learn how C# 9 lambda discard parameters use `_` for unused inputs, when they improve clarity, and how they apply to delegates, event handlers, and LINQ.