IVisualTreeService::AdviseVisualTreeChange method (xamlom.h)

Starts listening for changes to the visual tree.

Syntax

HRESULT AdviseVisualTreeChange(
  [in] IVisualTreeServiceCallback *pCallback
);

Parameters

[in] pCallback

The callback to register for mutation events.

Return value

If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.

Remarks

AdviseVisualTreeChange should be called when the caller wants to start listening for mutation events (changes to the visual tree). The callback will start receiving events once the visual tree is constructed. If already constructed, the caller will immediately receive mutation events.

Requirements

Requirement Value
Minimum supported client Windows 10 [desktop apps only]
Minimum supported server Windows Server 2016 [desktop apps only]
Target Platform Windows
Header xamlom.h

See also

IVisualTreeService