At PDC10 as part of the keynote, Scott Guthrie showed off the soon-to-be-released Silverlight Performance Analysis tool that would allow developers to profile their Windows Phone 7 applications and identify bottlenecks in frame rate and CPU and relate that back to specific storyboards and even Visual Tree elements.
This post provides screen shots of the tool and suggests a possible release date:
http://www.shazaml.com/archives/silverlight-performance-analysis-tool-coming-soon
While Silverlight for Windows Phone makes developing applications for WP7 “really easy”, this doesn’t change the fact that building a mobile app requires you to pay much more attention to the (un)availability of system resources like, memory.
There are three values you can monitor to ensure your app is using memory responsibly. They can be found in the Microsoft.Phone.Info.DeviceExtendedProperties class:
- DeviceTotalMemory is the least useful of these values, but might still be something you want to check out. It could be used to make decisions about whether or not to kick off a memory intensive process. You might use it similarly to the way you check the RenderTier in WPF – to show a better experience on devices that can handle it.
- ApplicationCurrentMemoryUsage can be used to ensure that in general you’re not trying to do too much with your app. One example of this from my experience is loading up too many pivot items in a pivot control. The recommended max is 7, but depending on what you’re doing in them, you might find that’s too many. If your current memory usage is bumping up against the max, you definitely need to do something to reclaim some memory.
- ApplicationPeakMemoryUsage can be used for your own pre-certification testing to ensure you never go over the 90MB max threshhold.
To ensure you don’t stray too far down the wrong path, it’s good to frequently check these numbers. If you have metrics like this right in front of you while running the app, even better. So I created a control to periodically check these values and optionally show them at runtime. You can use this control strictly for testing purposes, or you can use it to make decisions a runtime about what if anything you need to dump to get back into the safe zone for memory usage.
It's easy to use, on Application Launching and Application Activated, new it up:
MemoryMonitor memoryMonitor = new MemoryMonitor(isEnabled, showVisualization);
Then when run the app, you'll see this at the top of your screen:

You might want to change it's configuration based on compilation switches, only showing the visualization in debug mode. You might want to only new it up in debug mode. You might want to keep it running, tracking memory usage throughout the lifetime of your application, and when current memory usage exceeds a threshold, be notified so you can clean stuff up. It'll handle these scenarios.
So like any stuff you do when you’re down in it, you find it useful but others might not. Take it, change it, improve it, do what you want with it. I found it useful, maybe you will, too. If you do something good, share it back.
MemoryMonitor.cs (17.65 kb)
A colleague recently asked if there was an easy way to determine if the user has denied access to the Location Service. From MSDN documentation:
If you attempt to start data acquisition from the Location Service and the Status property is Disabled, the user may have disabled the Location Service on their phone. You can determine this by checking to see if the Permission property is Denied. If so, you may want to alert the user so that they can enable the service if they choose to do so.
So my next question would be, if the Status of Disabled means the user MAY have disabled the Location Service on their phone, what other stuff would result in a Disabled status? And do you actually need to attempt to Start the watcher to get an accurate Permission value?
This post gives needed details about the yet-to-go-public Panorama and Pivot controls. These can be found in the interim bits for those with special pre-launch agreements.
Jeff Wilcox – Looking ahead: Panorama and Pivot controls for Windows Phone developers
Easily get started creating Windows Phone 7 applications using the Caliburn.Micro framework and this Visual Studio project template.

More details at:
Visual Studio Project Template for Caliburn.Micro WP7 | SHAZAML!

Windows Phone 7 UI Pattern for Pivot Views:
WP7 UI Pattern: Pivot Views | SHAZAML!
Post that describes the a Windows Phone 7 pattern for layered panoramas:
WP7 UI Pattern: Layered Panorama | SHAZAML!