WPF Learning Path (vii) Applications and Windows (cont.)

Source: Internet
Author: User

The life cycle of a window

A Windows class in WPF represents a window

The life cycle of a window also has several stages:

1, the constructor is called

2. The Window.initialized event is triggered

3. The window.activated event is triggered

4. The window.loaded event is triggered

5. The Window.contentrendered event is triggered

6, the user and the window to interact (actived and deactived state switch each other)

7. The Window.closing event is triggered

8. The window.uloaded event is triggered

9. The window.closed event is triggered

Activated and deactivated occur multiple times in the window's life cycle when the user switches between multiple windows. The contentrendered event fires only when the window is fully present for the first time.

In order to get things done immediately before all content is displayed to the user, you can use the loaded event;

To make things happen immediately after all the content is displayed to the user, you can use the Contentrendered event.

Window Properties

It is divided into two main categories: position size, appearance style

Detailed Introduction to MSDN

Https://msdn.microsoft.com/en-us/library/system.windows.window_properties (v=vs.110). aspx

To be continue ...

WPF Learning Path (vii) Applications and Windows (cont.)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.