Bitesized tidbits for building Modern (Metro) apps.
In my previous post, I talked about how to receive messages from a UDP broadcast, and for the Windows 8 app I’m writing, I wanted the results of this to be shown in the settings charm. But here I ran into a problem, the Dispatcher kept failing with an NullReferenceException on Window.Current and so the results of my broadcast never got shown in the settings page. I asked on twitter, but got no response, so I’ve had to resort to what feels like a bit of a dirty workaround, but there you go.
I’m sure you’ve seen plenty of mobile apps that do a search for a device on the network (say a bluray player) and it magically finds your device on your network. Looks pretty cool, right? Would be great to add that into your app wouldn’t it. Well, as long as you’re not developing for Windows Phone 7, then I will show how.
For an app I’m writing at the moment, I needed to use the camera within the app, but I needed it to be able to focus without the flash turning on every time. I was using the PhotoCamera object within my app and I figured I could just set the FlashMode to be FlashMode.Off. The problem came when my View loaded up, it would throw an exception, every, single, time. Which was starting to get a bit annoying, so what to do?
When building a Windows Phone or Windows Store app, one of the key things you might need are icons for your application bars (or other buttons); there are some good places to get different sets of icons from, including Syncfusion’s Metro Studio, but there is one place I like to get my icons from for both types of projects.