C# Class PrintSample.DisablePreviewPrintHelper

This class customizes the standard PrintHelper in order to disable print preview.
The PrintTaskRequestedMethod sets printTask.IsPreviewEnabled to false in order to disable print preview. Since print preview is disabled, the Paginate event will not be raised. Instead, the pages to be printed are generated in response to the AddPages event.
Inheritance: PrintSample.PrintHelper
Afficher le fichier Open project: unoplatform/Uno.Windows-universal-samples Class Usage Examples

Méthodes publiques

Méthode Description
DisablePreviewPrintHelper ( PrintSample.Page scenarioPage ) : SDKTemplate

Méthodes protégées

Méthode Description
AddOnePrintPage ( RichTextBlockOverflow lastRTBOAdded, PrintPageDescription printPageDescription ) : RichTextBlockOverflow

This function creates and adds one print page to the internal cache of print pages pages stored in printPages.

AddPrintPages ( object sender, AddPagesEventArgs e ) : void

This is the event handler for PrintDocument.AddPages. It provides all pages to be printed, in the form of UIElements, to an instance of PrintDocument. PrintDocument subsequently converts the UIElements into a pages that the Windows print system can deal with.

PrintTaskRequested ( PrintManager sender, PrintTaskRequestedEventArgs e ) : void

This is the event handler for PrintManager.PrintTaskRequested. In order to ensure a good user experience, the system requires that the app handle the PrintTaskRequested event within the time specified by PrintTaskRequestedEventArgs.Request.Deadline. Therefore, we use this handler to only create the print task. The print settings customization can be done when the print document source is requested.

Method Details

AddOnePrintPage() protected méthode

This function creates and adds one print page to the internal cache of print pages pages stored in printPages.
protected AddOnePrintPage ( RichTextBlockOverflow lastRTBOAdded, PrintPageDescription printPageDescription ) : RichTextBlockOverflow
lastRTBOAdded RichTextBlockOverflow Last RichTextBlockOverflow element added in the current content
printPageDescription PrintPageDescription Printer's page description
Résultat RichTextBlockOverflow

AddPrintPages() protected méthode

This is the event handler for PrintDocument.AddPages. It provides all pages to be printed, in the form of UIElements, to an instance of PrintDocument. PrintDocument subsequently converts the UIElements into a pages that the Windows print system can deal with.
protected AddPrintPages ( object sender, AddPagesEventArgs e ) : void
sender object PrintDocument
e AddPagesEventArgs Add page event arguments containing a print task options reference
Résultat void

DisablePreviewPrintHelper() public méthode

public DisablePreviewPrintHelper ( PrintSample.Page scenarioPage ) : SDKTemplate
scenarioPage PrintSample.Page
Résultat SDKTemplate

PrintTaskRequested() protected méthode

This is the event handler for PrintManager.PrintTaskRequested. In order to ensure a good user experience, the system requires that the app handle the PrintTaskRequested event within the time specified by PrintTaskRequestedEventArgs.Request.Deadline. Therefore, we use this handler to only create the print task. The print settings customization can be done when the print document source is requested.
protected PrintTaskRequested ( PrintManager sender, PrintTaskRequestedEventArgs e ) : void
sender PrintManager PrintManager
e PrintTaskRequestedEventArgs PrintTaskRequestedEventArgs
Résultat void