Configuring Displayed Options

If you pass the PrintTaskOptions object to PrintTaskOptionDetails.GetFromPrintTaskOptions, you get back a PrintTaskOptionDetails instance that can be used to completely customize which options are displayed inside the Print pane. You can add, remove, and reorder them. The following change clears the default list of options and adds four specific ones:

void OnPrintTaskRequested(PrintManager sender, PrintTaskRequestedEventArgs args) {   // This is invoked when the Print pane opens   PrintTask task = args.Request.CreatePrintTask("Document Title",     async (taskArgs) =>     {       ...     });   PrintTaskOptionDetails details =     PrintTaskOptionDetails.GetFromPrintTaskOptions(task.Options); ...

Get Universal Windows® Apps with XAML and C# Unleashed now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.