Metro Nuggets

Bitesized tidbits for building Modern (Metro) apps.

Monthly Archives: June 2013

Belatedly Introducing LiveSDKHelper

A while back I was working on a project that allowed me to actually look at, and use, the Live SDK in order to access information on SkyDrive. I was surprised to find just how hard it was to use the Live SDK, so as part of building the main project, I also built a little helper for using the Live SDK.

Read more of this post

Advertisements

Introducing the ScoreoidPortable PCL

For a game I’ve been writing the last few weeks, I’ve been using an online scoring system in order to keep a track of people’s best scores whilst playing the game. What I’ve been using is Scoreoid, which is a cross platform scoring platform. It’s actually pretty easy to get yourself set up with Scoreoid, but that’s not the purpose of this post.

Their API is a REST based one and has a pretty expansive list of calls, from player creation, to score creation to leaderboards, etc. Initially, I looked to see whether anyone had already created any kind of helper library for Scoreoid and found Scoreoid for Windows 8 which I had to tweak in order to use it in my Windows Phone game. Unfortunately, the number of methods it had implemented was somewhat limited, I guess Rudy only implemented the ones he needed, so I found I was going to be adding a lot to his existing code base. In the end, I decided I’d write my own version and have the library how I wanted it (naming conventions etc).

So that’s what I did.

Read more of this post

Launching a Context Menu From Code

One of the great things the Windows Phone Toolkit brings developers is the ContextMenu and ContextMenuService that allows developers to offer their users a tap and hold menu, the same kind that appears in the OS itself.

Generally, you would create the context menu in xaml and attach it to an item within your page (or DataTemplate), but what if you want the user to be able to tap a button and have it appear? If you create the ContextMenu as normal in xaml then try and launch it from code, you’ll end up with an exception being through that the Element is already a child of another element. But if you create it in code, then it might not appear where you want it to appear, so what then?

Read more of this post

Tip: Nokia Ad Exchange (NAX) and Annoying Unhandled Exceptions

One of the ways in which developers try to increase their revenue is to include ads within their app and there are a number of different providers, from Google to Microsoft to Nokia. All seem to have one thing in common: Unhandled Exceptions. For some reason, ad controls seem to be some of the biggest culprits for unhandled exceptions in apps, and better still, there’s nothing you can do to actually handle them. Nothing. Not. A. Damn. Thing! So how do you stop your app from sinking without a trace in a barrage of error reports? Nothing elegant, I can tell you that, but it works.

Read more of this post

Coding4Fun Toolkit: Introducing LockScreenPreview

Previously I spoke about the SuperImage control that came into 2.0.6 of the Coding4Fun Toolkit today, well now I want to introduce you to another new control, LockScreenPreview. LockScreenPreview is a control for Windows Phone 8 and Windows Store (not Windows Phone 7), that does exactly what the control name suggests it does, it offers you a preview of what a user’s lock screen will look like.

Read more of this post

Coding4Fun Toolkit: Introducing SuperImage

The Coding4Fun toolkit for Windows Phone and Windows Store was updated recently to 2.0.6, and one of the new things to find its way into the toolkit is a new control called SuperImage. SuperImage is a control for Windows Phone and Windows Store that is basically a multipurpose Image control that you could use instead of a normal Image.

Read more of this post

Using the CustomMessageBox in OnBackKeyPressed

Sometimes in your app you may need to prompt the user for something when they’ve tapped the back button on the phone. If you wanted to offer the user a little more than just Ok/Cancel buttons, then you might have thought about using the CustomMessageBox from the Windows Phone toolkit, I know I did. But I was running into a nightmare problem where the user would press back, the prompt would  should and then almost instantly close. Every blog post I could find had the code in the same way, so how to fix?

 

Read more of this post