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...
View ArticleBeware 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...
View ArticleDifferent approach for animation in XAML using .NET 4.5 new async...
This post discusses a small set of classes we use to do dynamic animation in XAML apps – animation where the developer, at design time, might not know a lot about what needs to be animated and when....
View ArticleAwaitable ManagedAnimation class for WinRT (Part 2)
In the first part of this post series, I discussed the reasoning behind potentially wanting to have a second way of doing animation in XAML. In this post, I will discuss the basic infrastructure for...
View ArticleAwaitable Managed Animation classes for WinRT (Part 3)
In the previous two posts, I set up the reasoning and infrastructure for creating a different type of animation infrastructure. In this post, I’ll (finally) show an actual example of how to use this...
View ArticleAwaitable 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...
View ArticleHow 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...
View ArticleEasy 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...
View ArticleHow 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...
View ArticleFive 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...
View Article