Xamarin.CommunityToolkit by Microsoft

<PackageReference Include="Xamarin.CommunityToolkit" Version="2.0.6" />

 WeakEventManager<TEventArgs>

public class WeakEventManager<TEventArgs>
Weak event manager that allows for garbage collection when the EventHandler is still subscribed

public void AddEventHandler(EventHandler<TEventArgs> handler, string eventName = "")

Adds the event handler

public void AddEventHandler(Action<TEventArgs> action, string eventName = "")

Adds the event handler

public void HandleEvent(object sender, TEventArgs eventArgs, string eventName)

Invokes the event EventHandler

public void HandleEvent(TEventArgs eventArgs, string eventName)

Invokes the event Action

public void RaiseEvent(object sender, TEventArgs eventArgs, string eventName)

Invokes the event EventHandler

public void RaiseEvent(TEventArgs eventArgs, string eventName)

Invokes the event Action

public void RemoveEventHandler(EventHandler<TEventArgs> handler, string eventName = "")

Removes the event handler

public void RemoveEventHandler(Action<TEventArgs> action, string eventName = "")

Removes the event handler