Share via


IXRVisualStateGroup::AddVisualStateChangedEventHandler (Compact 2013)

3/28/2014

This method attaches a delegate to the VisualStateChanged event for this visual-state group. When the VisualStateChanged event occurs, this delegate will be invoked.

Syntax

virtual HRESULT STDMETHODCALLTYPE AddVisualStateChangedEventHandler(
    __in IXRDelegate<XRValueChangedEventArgs<IXRVisualState *>>* pDelegate
)= 0;

Parameters

  • pDelegate
    [in] IXRDelegate<ArgType, [SenderType]> object that you want to attach to the VisualStateChanged event, which occurs when a control transitions into a different state.

    The CreateDelegate function provides an easy way to create this IXRDelegate object.

Return Value

Returns an HRESULT that indicates success or failure.

Returns XR_E_INVALID_OBJECT if pDelegate is not a XAML for Windows Embedded object.

Remarks

This event occurs after the control goes to a new state and after the VisualStateChanging event occurs.

Multiple delegates can be attached to the same event.

To remove this delegate from the VisualStateChanged event, call IXRVisualStateGroup::RemoveVisualStateChangedEventHandler.

.NET Framework Equivalent

None.

Requirements

Header

XamlRuntime.h,
XRDelegate.h

sysgen

SYSGEN_XAML_RUNTIME

See Also

Reference

IXRVisualStateGroup
IXRVisualStateGroup::AddVisualStateChangingEventHandler
XRValueChangedEventArgs<_ValueType>