Here’s a quick example on how to implement an asynchronous call in WPF using the System.Threading.Tasks.Task class. Keep in mind that underneath, the call will still end up in a thread pool, as opposed to a ThreadPool approach.
public void StartAsyncTask()
private int DoAsyncWork()
// Do work and return result.
private void ValidateResults(Task<int> task)
var result = task.Result;
// Do some UI Thread stuff...
The trick is to use TaskScheduler.FromCurrentSynchronizationContext() to make sure we can work in the UI Thread. ContinueWith sets up a follow-up call to do some final work and that’s it.
This reference tutorial will help you grasp the power of WinDebug debugging tool and quickly start using it in your daily development tasks. So, before we start, let me explain what WinDbg is. WinDbg is a multipurpose debugger for Microsoft Windows, distributed on the web by Microsoft. It can be used to debug user mode applications, drivers, and the operating system itself in kernel mode. It is a GUI application, but has little in common with the more well-known, but less powerful, Visual Studio Debugger. WinDbg can be used for debugging kernel-mode memory dumps, created after what is commonly called […]
There’s a time when new feature or frameworks arise and you get to know them and immediately grasp that new and useful way of doing things, but there are also times when clarity only comes after a bit of blurriness. From what I’ve read, the new Dynamic type in c# 4.0 is currently one of such cases, when compared to var. I read many developers say “What’s the point?” or “Why do I need this?”. Well, I believe it’s a matter of architectural needs, mixed with coding style. To break this discussion into pieces, and because I feel the force […]
Microsoft recently released an updated version of their Facebook SDK for .NET developers. This is the result of a joint partnership between Clarity Consulting and the Concept Development Team at Microsoft. According to Microsoft “the goal is to enable .NET developers to quickly and easily leverage the various features of the Facebook Platform.” The software giant has provided samples and tools for helping develop Facebook applications in the various .NET platforms including: ASP.NET, Silverlight, WPF and WinForms. Microsoft has also release the source code for the API, components, controls, and samples.” The main goals driving the release of version 3.0 […]
The Patterns & Practices team recently released their second version of the Application Architecture Guide 2.0. This guide is an essencial key for everyone who wish to step up to the next level of .NET Framework software development, by applying the best practices on their software technologies. It provides design-level guidance for the architecture and design of applications and focuses on the most common types of applications, partitioning application functionality into layers, components, and services, and walks through their key design characteristics. You can reach their codeplex website here. Download the guide here (released 15 Jan 2008). Nice readings!
Microsoft released today the .NET Framework 3.5 SP1 GDR (General Distribution Release). This release addresses some issues and should only be installed if you have some kind of issue. Otherwise, it is not recommended to do so. You better wait. In case you don’t know what a GDR is, here’s a quick explanation: A GDR addresses an issue that has a broad customer impact, that has security implications, or that has both. It is determined and issued by Microsoft as appropriate and when appropriate. GDRs are kept to a minimum and cannot be requested by a customer. Microsoft internally determines […]