PrintTaskOptionChangedEventArgs
PrintTaskOptionChangedEventArgs
PrintTaskOptionChangedEventArgs
PrintTaskOptionChangedEventArgs
Class
Definition
Called when a print task option has changed.
public : sealed class PrintTaskOptionChangedEventArgs : IPrintTaskOptionChangedEventArgspublic sealed class PrintTaskOptionChangedEventArgs : IPrintTaskOptionChangedEventArgsPublic NotInheritable Class PrintTaskOptionChangedEventArgs Implements IPrintTaskOptionChangedEventArgs// You can use this class in JavaScript.
- Attributes
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)
|
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) { }
Properties
OptionId OptionId OptionId OptionId
Gets the ID of the print task option that changed.
public : PlatForm::Object OptionId { get; }public object OptionId { get; }Public ReadOnly Property OptionId As object// You can use this property in JavaScript.
- Value
- PlatForm::Object object object object
The ID of the property that changed.