I have a WPF user control and I want to be able to print it using PrintDialog.PrintVisual(). I don't want to show the print dialog so I want to be able to set a specific printer and printer tray to print it to. I figured out how to print to a specific printer but I need to print to "Tray 3" of my printer and I can't figure out how.
PrintDialog dialog = new PrintDialog();
LocalPrintServer localPrintServer = new LocalPrintServer();
PrintQueue pq = localPrintServer.GetPrintQueue("HC102-HP5SIMXX");
dialog.PrintQueue = pq;
//Set printer tray somehow
dialog.PrintVisual(myControl, "My control");