Author Archives: SocialEbola

Beware of FirstOrDefault() when using sqlite-net

Overall, using sqlite under Windows 8 has been a neat experience. Stuff seems to work, which is nice. There are a couple of things that were a surprise to me though – the last of them being that FirstOrDefault() does … Continue reading

Posted in Dev, Windows8 | Leave a comment

Memory leak in BitmapEncoder.GetPropertiesAsync and how to deal with it

Accessing photo metadata with the Windows Runtime (WinRT) is a fairly simple matter. StorageFile contains functions for accessing various types of properties – photo-related ones included. Some properties, however, need to be accessed a different manner – specifically, the XMP … Continue reading

Posted in Dev, Windows8 | Tagged , , , , , , | Leave a comment

Five concepts that completely changed how I write code

(Note that the dates in this post are approximate and are when I discovered said concepts – they may have been around for a while by then, but it may have taken me time to learn about them) Every developer … Continue reading

Posted in Uncategorized | Leave a comment

How to use CreateStreamedFileAsync

The StorageFile.CreateStreamedFileAsync is a pretty neat mechanism that allows you to take a stream and use it like an IStorageFile. This is useful in a number of scenarios – especially ones where you are communicating with the OS or other … Continue reading

Posted in Dev, Windows8 | Tagged , , | Leave a comment

Easy resource acquisition/disposal with yield returns

I love C#’s using keyword for quick resource acquisition/disposal. Together with foreach, it’s one of the first syntactical sugar pieces baked into C# and it’s a boon for keeping code tight, readable and maintainable. On top of the classic usages … Continue reading

Posted in Dev | Tagged , , | Leave a comment

How to await a CancellationToken

Cancellation tokens are a way for asynchronous operations to allow the caller to cancel them. The mechanism is pretty damn robust – the same token can be propagated along multiple nested operations such that a cancellation of the top-level object … Continue reading

Posted in Dev, Windows8 | Leave a comment

Awaitable Managed Animation classes for WinRT (Part 4)

So far in this post series, I showed how to use code and the new async patterns of WinRT to simplify the animation of elements. As an example, I used opacity, showing how you can code your animation dynamically. In … Continue reading

Posted in Animation, Dev, Windows8 | Leave a comment