PrintTaskOptionChangedEventArgs class

Applies to Windows only

Called when a print task option has changed.

Syntax


/* For information about creating or accessing this object, see Remarks. */

Attributes

[MarshalingBehavior(Agile)]
[Version(0x06020000)]

Members

The PrintTaskOptionChangedEventArgs class has these types of members:

Methods

The PrintTaskOptionChangedEventArgs class inherits methods from the Object class (C#/VB/C++).

Properties

The PrintTaskOptionChangedEventArgs class has these properties.

PropertyAccess typeDescription

OptionId

Read-onlyGets the ID of the print task option that changed.

 

Remarks

Here is a code snippet that shows how to retrieve the object, when a print task option has changed. First, the app must register to listen for option changes. Once the option is changed, a callback is made to the event listener. Note that in JavaScript, you must use Direct2D printing to change the preview or print content based on option changes because print template is no longer supported. For more information about Direct2D printing, see Printing and command lists.



// Retreive the advanced print task options
var printDetailedOptions = Windows.Graphics.Printing.OptionDetails.PrintTaskOptionDetails.getFromPrintTaskOptions(printTask.options);

// Create a new list option 
var pageRange = printDetailedOptions.createItemListOption("PageRange", "Page Range"); 
pageRange.addItem("PrintAll", "Print all"); 
pageRange.addItem("PrintSelection", "Print Selection"); 
pageRange.addItem("PrintRange", "Print Range"); 

// Add the custom option to the option list 
printDetailedOptions.displayedOptions.append("PageRange"); 

// Register the handler for option change event. 
printDetailedOptions.onoptionchanged = onOptionsChanged; 
//The callback function for when an option has changed. optionsEvent is an object of type: PrintTaskOptionChangedEventArgs
function onOptionsChanged(optionsEvent) { } 
 


Requirements

Minimum supported client

Windows 8 [Windows Store apps only]

Minimum supported server

Windows Server 2012 [Windows Store apps only]

Minimum supported phone

None supported

Namespace

Windows.Graphics.Printing.OptionDetails
Windows::Graphics::Printing::OptionDetails [C++]

Metadata

Windows.winmd

 

 

Show:
© 2014 Microsoft