concept Print method in category silverlight

appears as: Print method, The Print method
Silverlight 4 in Action: Silverlight 4, MVVM, and WCF RIA Services

This is an excerpt from Manning's book Silverlight 4 in Action: Silverlight 4, MVVM, and WCF RIA Services.

As written, the code is fairly simple. It sets up the required PrintDocument class instance and calls the Print method. The Print method is asynchronous: it immediately returns once you call it. But it raises all of its events back on the calling thread, so the UI thread can still be blocked.

Note that in untrusted applications, the Print method must be called from a user-initiated event, such as a button click event. Trusted out-of-browser applications (see chapter 5) eliminate this restriction. Once you wire up the PrintPage event (coming up shortly), you’ll see that the print spool entry document name will contain the value passed into the Print method. Figure 19.2 shows the Windows 7 print spooler with a Silverlight print document spooled.