In .NET 4 the following snippet with a cached property can also be written using the System.Lazy class. I measured the performance of both approaches and it\'s pret
The Lazy is simpler—it clearly expresses the intent of the code. It's also thread safe.
Lazy
Note that if you're actually using this on multiple threads, you need to make it [ThreadStatic]; GDI+ objects cannot be shared across threads.
[ThreadStatic]