winrt::event_revoker struct template (C++/WinRT)

When you register a delegate, you can request an event revoker object (also known as an auto revoker). You can manually revoke your delegate by calling the event_revoker::revoke member function on that object, or you can just allow it to go out of scope. For more info, and a code example, see Revoke a registered delegate.

Syntax

template <typename I>
struct event_revoker

Template parameters

typename I The type of the event source (the object that raises the event).

Requirements

Minimum supported SDK: Windows SDK version 10.0.17134.0 (Windows 10, version 1803)

Namespace: winrt

Header: %WindowsSdkDir%Include<WindowsTargetPlatformVersion>\cppwinrt\winrt\base.h (included by default)

Member functions

Function Description
event_revoker::revoke function Revokes the delegate from whose registration the event_revoker object was returned.

event_revoker::revoke function

Revokes the delegate from whose registration the event_revoker object was returned.

Syntax

void revoke() noexcept;

See also