Поделиться через


DeviceNotificationHandler element

Identifies a device notification handler.

Usage

<DeviceNotificationHandler
  EventID = "xs:string"
  EventAsset = "xs:string"/>

Attributes

Attribute Type Required Description

EventAsset

xs:string

Yes

A value that you also specify in the app's manifest as the entry point for the background task extension. See Remarks

EventID

xs:string

Yes

The print event handler for the printer case, and the SMS event handler for the SMS device case.

Child elements

There are no child elements.

Parent elements

There are no parent elements.

XSD

<!-- Device Notification Handler Type Definition -->
<xs:complexType name="DeviceNotificationHandlerType">
    <xs:attribute name="EventID" type="xs:string" use="required"/>
    <xs:attribute name="EventAsset" type="xs:string" use="required"/>
</xs:complexType>

Remarks

Based on the DeviceNotificationHandler elements, the system calls the application and invokes the registered task in the application when the device enters a registered state. In Windows 8, this handler is supported for printers and SMS devices only.

The EventAsset attribute should match the EntryPoint attribute of the background task declaration in the app manifest. The EventID attribute should match the event handler name. For example, the EventAsset attribute would be "Microsoft.Samples.Printing.WwaDca.PrintNotificationHelper", and the EventID attribute would be "PrintNotificationHelper", given the app manifest that follows:

<Extension Category="windows.backgroundTasks" 
  Executable="backgroundTaskHost.exe" 
  EntryPoint="Microsoft.Samples.Printing.WwaDca.PrintNotificationHelper">

Element information

Minimum supported system

Windows 8
Can be empty Yes

See also

SoftwareInfo XML Example

 

 

Send comments about this topic to Microsoft