Update: Kudos to Murat and Rudy Huyn for pointing me out on a missing return; that would cause the NotSupportedException to be raised all the time… I’ve fixed the code by inverting the if condition.

Update 2: Just noticed that GDR2 is also supported, as the code below will also work in devices with it! :)

Windows Phone 8 made it possible to take a screenshot of your screen at any time, just by pressing the Windows and Power button at the same time.

Sure, this is a really cool feature and can be quite handy from time to time, but it can become a security concern for some specific scenarios, not to mention a way to copy someone else’s graphical designs!

Since Windows Phone 8 update 3 (GDR2) there is now a hidden feature that allows you to disable the Screenshot functionality on a page by page basis: the PhoneApplicationPage.IsScreenCaptureEnabled!

This is a hidden property that requires Reflection in order to access and modify it’s state. The following extension methods will help you with that:

publicstaticclassPhoneApplicationPageExtensionMethods{publicstaticboolCanSetScreenCaptureEnabled(thisPhoneApplicationPagepage){returnEnvironment.OSVersion.Version>=newVersion(8,0,10322);}publicstaticvoidSetScreenCaptureEnabled(thisPhoneApplicationPagepage,boolenabled){varpropertyInfo=typeof(PhoneApplicationPage).GetProperty("IsScreenCaptureEnabled");if(propertyInfo==null){thrownewNotSupportedException("Not supported in this Windows Phone version!");}propertyInfo.SetValue(page,enabled);}publicstaticboolGetScreenCaptureEnabled(thisPhoneApplicationPagepage){varpropertyInfo=typeof(PhoneApplicationPage).GetProperty("IsScreenCaptureEnabled");if(propertyInfo==null){thrownewNotSupportedException("Not supported in this Windows Phone version!");}return(bool)propertyInfo.GetValue(page);}}

The first step is to call CanSetScreenCaptureEnabled() from inside your PhoneApplicationPage to check if the Windows Phone version is at least Windows Phone 8 update 3 (version 8.0.10322) as that is the minimum required version for this to work!

If it is, we can then use the GetScreenCaptureEnabled() and SetScreenCaptureEnabled() extension methods to change the property value!

So you got a brand new Windows Phone device for Christmas and still don’t know what to install on it?

Then look no further: here is the list of the best apps I have installed on my own phone! :)

Social

Twitter - The fully featured Twitter app with multiple account support and push notifications that actually do work!

Facebook Beta - There is also a non-beta Facebook official app, but I prefer the beta one as it gives me the latest features sooner! ;)

4th & Mayor - I know that there is an official Foursquare app and that it’s a lot better than the first version, but I still prefer 4th & Mayor from Jeff Wilcox as it is quite simpler and uses a more direct approach!

WhatsApp - free messaging that works on pretty much any phone? Yes, thank you very much! :)

Skype - The official Skype app, really good when it actually works… this is the one app I really need and sometimes fails me miserably :\

6tag - developed by Rudy Huyn, probably the best Instagram app for Windows Phone. There is an official Instagram BETA app, but it’s still lacking some features…

Disqus - It’s probably the most used network for commenting on forums and blogs everywhere!

LinkedIn - LinkedIn official app, to keep in eye on your professional connections.

Lifestyle / Shopping

eBay - The app is quite simple and could use a better look, but it works well and does a proper job alerting when auctions are about to end.

Travel + Navigation

Geosense - quite useful to convert from different GPS coordinates types, to get my location, open KML files from Google Earth… and yes, I wrote it and that’s also another reason why it’s here, so sue me! :P

TripAdvisor - I always like to read the reviews on hotels and restaurants on TripAdvisor before I actually go to the place.

Personal Finance

Photo

Tile Me! - Create a Windows Phone tile picture with this app, and use it everywhere! :D

Music + Video

YouTube - a couple a months ago there was an official YouTube app (and it was really good, I might add), but Google pulled the plug on it and so we are stuck with just this miserable plugin and YouTube mobile website…

Shazam - You know when you’re in a party, listening to a music that you actually like and don’t know who the artist is? That’s when Shazam comes quite handy!

WVGA(480x800, 1.0x scale factor) - this is the only resolution available in WP7

WXGA(768x1280, 1.6x scale factor)

16:9

720p(720x1280, 1.5x scale factor)

1080p(1080x1920, 2.25x scale factor) - only supported in the new large screen devices with WP8 update 3

As a Windows Phone developer/designer, you don’t need to know this!

All you need to do is design the interface in XAML for the 480x800 resolution, and it will automatically scale up using a fixed scale factor! How cool is that? :)

Now if you really want to know what is the device scale factor (maybe to create different app resolution-aware layouts), you can read the Application.Current.Host.Content.ScaleFactor (note: this property will return the scale factor * 100).

But there’s a catch: for the new 1080p devices, the scale factor is returned as 1.5x, just as the 720p devices, instead of the correct 2.25x…

In WP8 update 3 you can use DeviceExtendedProperties.TryGetValue("PhysicalScreenResolution", out physicalScreenResolutionObject) to retrieve the screen Size resolution in pixels, take the Width of it and divide it by 4.8 to know the correct scale factor.

If the call to DeviceExtendedProperties.TryGetValue fails it just means you don’t have a WP8 GDR3 device, and as such the device is not a 1080p device and you can just fallback to use the Application.Current.Host.Content.ScaleFactor approach!

If we do as before and retrieve and decode the encodedLaunchUri, we will get "my-app://do/stuff/?param1=a&b&param2=c", which in this case, doesn’t match the original deep link!

This behavior is due to Internet Explorer in Windows Phone, as it seems to decode all links before trying to navigate to them, and when it can’t perform the navigation (e.g. when the link isn’t a http:// or https:// link) it just sends it to the platform to handle it, but by that time the link has already been wrongly re-encoded!

So far I haven’t been able to find any way of bypassing this issue, apart of simply not using the & in my apps deep links… and my advice to you is to proceed just like this!

Most desktop applications use the Tab key to jump focus from one control to the next one, and this is expected behavior and common knowledge to most users.

On Android, the on-screen keyboard normally shows a “Next” key to - yes, you’ve guessed it! - go to the next field, and that is something really useful when filling long forms!

In truth, some native Windows Phone apps actually do this on some fields, where tapping the Enter key will have the same result, but unfortunately this is not the default behavior.

You could simulate this behavior using the TextBox.KeyUp or TextBox.KeyDown events, and then calling Control.Focus() on the next control you want to get focus, but I guess we can all agree that this is quite some work and if you change the fields order, you’d have to change the code accordingly.