PrintTaskOptionChangedEventArgs PrintTaskOptionChangedEventArgs PrintTaskOptionChangedEventArgs PrintTaskOptionChangedEventArgs PrintTaskOptionChangedEventArgs Class


Called when a print task option has changed.

public : sealed class PrintTaskOptionChangedEventArgs
struct winrt::Windows::Graphics::Printing::OptionDetails::PrintTaskOptionChangedEventArgs
public sealed class PrintTaskOptionChangedEventArgs
Public NotInheritable Class PrintTaskOptionChangedEventArgs
// This class does not provide a public constructor.

Windows 10 requirements

Device family
Windows 10 (introduced v10.0.10240.0 - for Xbox, see UWP features that aren't yet supported on Xbox)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)


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 

// 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) { } 


OptionId OptionId OptionId OptionId OptionId

Gets the ID of the print task option that changed.