本文是“Windows Phone 7 开发 31 日谈”系列的第9日。
在过去的几天中,我们讨论了启动器和选择器,在某些情况下没有硬件调试是十分困难的。今天,我们来谈谈调试,以及一些可供我们用来优化应用程序的工具。
Application.Current.Host.Settings
如果打开你的App.xaml文件,会看到有这样的语句:
// 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;
}
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;
}