Share via


PrintNotificationEventDetails Class

Definition

Contains properties that allow a client to access and/or manipulate print event data and print device name information.

public ref class PrintNotificationEventDetails sealed
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Devices.Printers.Extensions.ExtensionsContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
class PrintNotificationEventDetails final
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Devices.Printers.Extensions.ExtensionsContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
public sealed class PrintNotificationEventDetails
Public NotInheritable Class PrintNotificationEventDetails
Inheritance
Object Platform::Object IInspectable PrintNotificationEventDetails
Attributes

Windows requirements

Device family
Windows Desktop Extension SDK (introduced in 10.0.10240.0)
API contract
Windows.Devices.Printers.Extensions.ExtensionsContract (introduced in v1.0)

Remarks

Background task handlers can use local storage to save the PrinterName and EventData values of the PrintNotificationEventDetails class, so that the information can be used later by an app.

// Save the printer name and asyncUI xml
//
var keyPrinterName = "BA5857FA-DE2C-4A4A-BEF2-49D8B4130A39";
var keyAsyncUIXML = "55DCA47A-BEE9-43EB-A7C8-92ECA2FA0685";
var settings = Windows.Storage.ApplicationData.current.localSettings;

//
// The background task instance's activation parameters are available
// via Windows.UI.WebUI.WebUIBackgroundTaskInstance.current
//
var backgroundTaskInstance = Windows.UI.WebUI.WebUIBackgroundTaskInstance.current;

// Save data into a user-defined var, "settings" 
var details = backgroundTaskInstance.triggerDetails;
settings.values[keyPrinterName] = details.printerName;
settings.values[keyAsyncUIXML] = details.eventData;

// Save directly into PrintNotificationEventDetails
Windows.Devices.Printers.Extensions.PrintNotificationEventDetails = details;

For more information about using the PrintNotificationEventDetails class, see the UWP device apps for printers topic on the Hardware Dev Center.

Properties

EventData

Gets or sets the event data for a print notification event.

PrinterName

Gets the name of the print device associated with the print notification.

Applies to

See also