Skip to content

Commit

Permalink
Merge pull request #294 from mtaron/updateprinter
Browse files Browse the repository at this point in the history
Update print preview when switching printers
  • Loading branch information
damyanp committed Mar 4, 2016
2 parents 61f7329 + 38c7716 commit ba3e4aa
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions samples/ExampleGallery/Shared/PrintingExample.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,18 @@ private void PrintingExample_PrintTaskRequested(PrintManager sender, PrintTaskRe
displayedOptions.Add(StandardPrintTaskOptions.MediaSize);
displayedOptions.Add(StandardPrintTaskOptions.Orientation);
displayedOptions.Add("PageRange");

detailedOptions.OptionChanged += PrintDetailedOptions_OptionChanged;
}

private void PrintDetailedOptions_OptionChanged(PrintTaskOptionDetails sender, PrintTaskOptionChangedEventArgs args)
{
if (args.OptionId == null)
{
// Invalidate the preview when switching printers.
this.printDocument.InvalidatePreview();
}
}

private async void PrintDocument_PrintTaskOptionsChanged(CanvasPrintDocument sender, CanvasPrintTaskOptionsChangedEventArgs args)
{
Expand Down

0 comments on commit ba3e4aa

Please sign in to comment.