HWH....

导航

 
 

Application

1.A program can create only one Application object, which exists as a constant anchor for the rest of the program.

2.You can create the Application object before creating the Window object, but the call to Run must be last.

3.Most subsequent programs in this book will include a using directive for System.Windows.Input even if they don't need it.

4.The MouseDown event is fired whenever the user clicks the client area of the window with any mouse button. The first argument to the event handler is the object firing the event, which is the Window object. The event handler can safely cast that object to an object of type Window.

5.GetPosition returns an object of type Point (a structure defined in System.Windows)

6. 

Window win = Application.Current.MainWindow;

Window curWindow
= sender as Window;

 

7.The OnSessionEnding method and SessionEnding event indicate that the user has chosen to log off the Windows session or shut down the computer.

                OnSessionEnding

                Onstartup

                OnExit

8.These calls are not strictly needed in these cases, but they can't hurt. It's generally wise, however, to call the base class method unless you have specific reasons for not doing so.

9. public static void Main(string[] args)

            Any command-line arguments are passed to Main as an array of strings. This array of strings can also be accessed in the OnStartup method as the Args property of the StartupEventArgs argument

10.  

app.ShutdownMode = ShutdownMode.OnMainWindowClose;

ShutdownMode
= ShutdownMode.OnMainWindowClose;

MainWindow
= win;

 

posted on 2011-03-21 12:54  HWH....  阅读(191)  评论(0编辑  收藏  举报