Skip to content

C# Feature - Partial events

Partial events allow one partial type declaration to define an event and another partial declaration to provide the implementation.

This feature was introduced in C# 14 under the broader “more partial members” work. The official Microsoft Learn page for C# 14 is dated November 18, 2025 and states that C# 14 ships with .NET 10 and Visual Studio 2026.

Partial events are mainly useful in source-generation and framework scenarios where one part of a type is generated and another part is handwritten.

public partial class OrderMonitor
{
public partial event EventHandler? Changed;
}
public partial class OrderMonitor
{
private EventHandler? _changed;
public partial event EventHandler? Changed
{
add => _changed += value;
remove => _changed -= value;
}
}
  • A partial event needs exactly one defining declaration and one implementing declaration.
  • The defining declaration uses field-like event syntax.
  • The implementing declaration must provide add and remove accessors.
  • This is a specialized feature; it is rarely needed in typical line-of-business application code.
  • Keep generator-produced and handwritten event declarations synchronized exactly.