Discussion on Windows Phone 7 development on the 31st day-9th: Debugging skills

Source: Internet
Author: User

This article is about Windows Phone 7 development on the 31st day"9th day of the series.

In the past few days, we have discussed starters and selectors. In some cases, it is very difficult to debug without hardware. Today, let's talk about debugging and some applications that we can use to optimize.Program.

Application. Current. Host. Settings

If you open your app. XAML file, you will see the following statement:

Code // Show graphics profiling information while debugging.
If (System. Diagnostics. Debugger. isattached)
{
// Display the current frame rate counters.
Application. Current. Host. settings. enableframeratecounter =   True ;
// Show the areas of the app that are being redrawn in each frame.
Application. Current. Host. settings. enableredrawregions =   True ;
// Enable non-production analysis visualization mode,
// Which shows areas of a page that are being GPU accelerated with a colored overlay.
Application. Current. Host. settings. enablecachevisualization =   True ;
}

This sectionCodeSome tools are opened to provide a large amount of information that is happening in the program during debugging. The following is a summary of what they do:

Enableframeratecounter

This is the only tool opened by default. It allows you to monitor the frame rate of an application when the program is running. You will notice that all these tools are included in an if Statement (debugger. isattached) because you will not use them in the final product program. These tools are dedicated for debugging. Check whether the debugger is a good way to unlock the menu and test your trial program. You can open some things during debugging, but you don't need to worry about them in other States.

The film industry standard is 24 frames per second, and you may not need so much unless there are complex animations or moves in your program. In Wikipedia, there is an article about "persistence of vision", which means that when the image seen by the human eye disappears, the human eye can still retain images of about 0.1-0.5 seconds .)Article.

Enableredrawregions

Open this debugging setting to see where the rectangle will be repainted in your application. When it is enabled, you can see that the repainted content is blue because the repainted area. This becomes very important when getting a lower frame rate, and you may not know why. This is because the application redraws a part of the screen, even if it is not obvious.

Enablecachevisualization

In another overlapping color, enablecachevisualization shows you which areas of the page use the GPU acceleration feature. You may expect video and animation to take full advantage of it, but I think you will be surprised at the frequency at which the GPU processes the image.

Download Sample Code

The above are some tips for tools available for program debugging. Tomorrow, let's discuss the input range and all the different forms of screen keyboards we can use.

Address: http://www.jeffblankenburg.com/post/31-Days-of-Windows-Phone-7c-Day-9-Debugger-Tips.aspx

If you like my article, click "recommendation ",Thank you!

Related Article

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.