Windows 8 Development-knowledge point summary at the beginner stage

Source: Internet
Author: User
After learning Win8 development for more than a month, I am working on a project. During this period, I encountered many difficulties and gained a lot of knowledge. Some things are self-learned, while others help me, for example, the devdiv forum is a good learning assistant. Let's take a look at a simple learning summary at this stage.
(1) The WP7 application is transplanted to the Metro-style application. It took a lot of effort, and database rewriting took most of the time. Refer to the blog: jump between pages in http://blog.csdn.net/moxiaomomo/article/details/8104556 (2. It is relatively simple. The core is to use a frame that supports navigation. If you need to switch between the systems such as snapview, fillview, and fullview, you 'd better implement a rootpage that manages all page switches. The rootpage has a built-in frame control and registers a sizechanged listener event.
(3) Use notification (toast) and Plan notification (scheduledtoast ). Event Notifications are supported. You can obtain the events and parameters from clicking toast to starting the application. You can place toast processing and acquisition in the background to avoid blocking UI interaction when the data volume is large.
(4) asynchronous programming. One obvious feature of Metro applications is that most of the provided APIs are run asynchronously (async/await ). This asynchronous mechanism is easy to use and beautiful, and improves the smoothness of UI interaction. But there is a problem. Sometimes we only want a synchronous operation, but the API does not support synchronous interfaces; can be asynchronously forged into synchronization (in fact, await is equivalent to creating a similar synchronization effect ?), However, it is always a bit uncomfortable to write.
(5) User-Defined usercontrol. This process is sometimes unpleasant and sometimes annoying. Sometimes you may feel that you can play it freely without system restrictions, but sometimes you may feel the same, complex, and rewrite a ListBox style requires n lines of code (XAML ). Pay attention to some things. Use Dependency Property as few as possible because it is very performance-consuming. If necessary, customize eventhandler to write the listening operation and processing logic to the outside of the control.
(6) data sources that can be monitored. If you want to implement databinding, and when the data source is updated, the corresponding controls are also updated. Generally, do the following:. the data source class inherits from the interface inotifypropertychanged; B. use observablecollection <DATA> instead of list <DATA>.
(7) Background threads. Threadpool can be used. you can also use the runasync () method. run () method, but the official recommendation is to use the task whenever possible, because the management of threads (such as the cancelrun operation) provides a safer and easier-to-use interface. For specific use, refer to the blog: http://blog.csdn.net/moxiaomomo/article/details/8210833or http://blog.csdn.net/moxiaomomo/article/details/8312902 (8) There are many other details, it will not be described. Mr Lin, the details of a client application are always important. Some things may only be used, but they do not have the opportunity to get a glimpse of its connotation mechanism, which is somewhat regrettable. Continue to learn. What I learned is only the tip of the iceberg, and the rest is still a long journey.

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.