IXRCustomEvent::Raise (Compact 7)
3/12/2014
This method raises a custom event.
Syntax
virtual HRESULT STDMETHODCALLTYPE Raise(
SenderType* pSender,
ArgType* pEventArg
) = 0;
Parameters
- pSender
[in] Pointer to the object sender that raises the custom event.
- pEventArg
[in] A structure that contains event data, for example, XRPropertyChangedCustomEventArgs.
Return Value
Returns an HRESULT that indicates success or failure.
Example
The following example code shows how to call IXRCustomEvent::Raise in a custom method implementation in a data-source object. The custom method sets the global variable that reflects the current time on the device by using the string in the [in] parameter pstrCurrentTime. Then, it creates and populates an XRPropertyChangedCustomEventArgs, and raises the custom event, supplying it with the XRPropertyChangedCustomEventArgs event data.
Important
For readability, the following code example does not contain security checking or error handling. Do not use the following code in a production environment.
#include <XamlRuntime.h>
WCHAR *m_pstrCurrentTime;
IXRCustomEvent<XRPropertyChangedCustomEventArgs, IXRPropertyBag> *m_pNotifyChangeEvent;
void SetCurrentTime(WCHAR* pstrCurrentTime)
{
m_pstrCurrentTime = pstrCurrentTime;
XRPropertyChangedCustomEventArgs args;
args.PropertyName = L"CurrentTime";
m_pNotifyChangeEvent->Raise(this, &args);
}
.NET Framework Equivalent
None.
Requirements
Header |
XamlRuntime.h |
sysgen |
SYSGEN_XAML_RUNTIME |