Image via WikipediaIntroduction to Article
As you may know, Silverlight 4 introduced the support for a basic printing functionality, through its Printing API (based on the PrintDocument class). This API allows you to send to a printer (in a bitmap-based way) your application screen, a portion of it, or an alternative custom visual-tree properly constructed.
In Silverlight, the printing support is limited in some ways for security reasons; for example:
- the print operation must be user-initiated (that is: only permitted in the context of a handler that handles a user event);
- the "Print" dialog box (that is the window depicted below, where the user can select the printer's settings and then click "Print" to continue or "Cancel" to cancel the print operation) is always shown.
Silent printing in Silverlight - CodeProject
Introduction to article
I've been using Almond and Maunder's DrawWireRects function because I always like my programs to look cool. That function is great and all, however, to use it I need to overload OnCreate and OnDestroy functions in EVERY dialog class which I want it to be effected, there are a few inconvenience on directly reusing the DrawWireRects function:
- If there are many (well, let's say 5) different kind of Dialog boxes I will be using in a project, each of which has to be a new class due to their different functionalities, then I need to overload
OnCreate and OnDestroy functions in every class and add some other members which are needed to complement the animation effect. Those will be quite a lot of duplicated code.
- Other than animating the dialogs, I may also want to make some adjustment from time to time, for example, I want a dialog with class name of
CMyDialog open from center and close towards its bottom-right corner, then a few minutes later I change my mind and want it close towards the system tray... anyway, I should be able to do those kind of stuff by simply using the DrawWireRects, but quickly I'll find out size of MyDialog.cpp grows up rapidly, and so do other dialog classes in that project.
It would be nice if there was an existing class that encapsulates all those necessary stuff, I could just derive my classes from it and it does all the dirty work for me. So that's where the CAniDialog class came from.
An Animation-Style Dialog Class - CodeProject