c# - wpf inherited DocumentViewer and Frame Navigation -
i wrote class inherits documentviewer
public class mydocumentviewer : documentviewer { public bool landscape{ get; set; } protected override void onprintcommand() { // print dialog, defaulted default printer , default printer's preferences. printdialog printdialog = new printdialog(); printdialog.printqueue = system.printing.localprintserver.getdefaultprintqueue(); printdialog.printticket = printdialog.printqueue.defaultprintticket; // reference fixeddocumentsequence viewer. fixeddocumentsequence docseq = this.document fixeddocumentsequence; // set default page orientation based on desired output. if(!landscape) printdialog.printticket.pageorientation = system.printing.pageorientation.portrait; else printdialog.printticket.pageorientation = system.printing.pageorientation.landscape; if (printdialog.showdialog() == true) { // set print ticket document sequence , write printer. docseq.printticket = printdialog.printticket; xpsdocumentwriter writer = system.printing.printqueue.createxpsdocumentwriter(printdialog.printqueue); writer.writeasync(docseq, printdialog.printticket); } } protected override void onmanipulationboundaryfeedback(system.windows.input.manipulationboundaryfeedbackeventargs e) { base.onmanipulationboundaryfeedback(e); e.handled = true; } }
i use viewer inter alia show xps file bookmarks, , after navigating bookmark, document reloaded in standard documentviewer. know how change style after reloading cannot find how resolve problem.
is possible change default viewer fixeddocument ?
if not, maybe knows way resolve it.
Comments
Post a Comment