Saturday, August 25, 2012

MSDN Magazine

One of my favorite magazine for .NET programmers is Microsoft’s MSDN Magazine, and over the years I have accumulated quite a library of them. What some people might not know is that the magazine is available online at http://msdn.microsoft.com/en-us/magazine/default.aspx. The most recent three issues are available in HTML format. Issues older then three months are available in HTML and most are also available for download in PDF or CHM format. Note that if you want to view the CHM files in Windows 8 you will need to right click on the file, select properties, the click the Unblock button otherwise you will not see the content when you open the file.

The magazine archive on the MSDN site actually goes all the way back to January of 2001. A lot of the information in these older issues is obsolete, but they are still worth taking a look at. While going through  the older issues I have found some very in depth articles on programming and .NET specific topics that are still relevant today. Here are a few you might want to take a look at:

Tame Your Software Dependencies for More Flexible Apps by James Kovacs

Digging into IDisposable by Shawn Farkas

An Introduction to Delegates by Jeffrey Richter

Thursday, August 23, 2012

WinRT App Tile Notification Update

Back when the developer preview of Windows  8 came out I did some blog posts on how to use the tile notification capability in new style WinRT apps. I have been going back over these posts to see what, if anything, has changed between then and the RTM release of Windows 8.
Metro App Tile Notification
The code in the original post works pretty much the same in the RTM version but I did run into one odd problem. In my original post I used the following line of code to get the XML node from the tile template:

 var textNode = xmlTemplate.SelectSingleNode("/title/visual/binding/text[@id='1']");

In the RTM this doesn’t work, the node is not be found. It turns out that this is the expected behavior since the SelectSingleNode method required the XML to have a namespace, otherwise it won’t find the node. I am not sure why this worked in the developer preview. There are ways to get around the missing namespace, but there is an easier solution:
 var textNode = xmlTemplate.GetElementsByTagName("text")[0];

This line achieves the same thing and doesn’t have the namespace issue. Other then this change everything in the original post works fine.