PrintNotificationEventDetails PrintNotificationEventDetails PrintNotificationEventDetails PrintNotificationEventDetails PrintNotificationEventDetails Class

Definition

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

public : sealed class PrintNotificationEventDetails : IPrintNotificationEventDetails
struct winrt::Windows::Devices::Printers::Extensions::PrintNotificationEventDetails : IPrintNotificationEventDetails
public sealed class PrintNotificationEventDetails : IPrintNotificationEventDetails
Public NotInheritable Class PrintNotificationEventDetails Implements IPrintNotificationEventDetails
// This class does not provide a public constructor.
Attributes
Windows 10 requirements
Device family
Windows Desktop Extension SDK (introduced v10.0.10240.0)
API contract
Windows.Devices.Printers.Extensions.ExtensionsContract (introduced v1)

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 EventData EventData EventData EventData

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

PrinterName PrinterName PrinterName PrinterName PrinterName

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

See Also