Alerting the User in Silverlight 2.0

Silverlight 1.1 lacked a managed equivalent of JavaScript’s window.alert, so when I wanted to pop up a message box (actually, an alert box) in Silverlight 1.1, I used the platform’s DOM integration features to fire a scriptable event from C# and handle the event in JavaScript. Then, in the event handler, I called window.alert. There’s no…

Loading Images from the Local File System in Silverlight 2.0

In Silverlight 1.1, it was impossible to load images from the local file system unless you uploaded them to a server first. In Silverlight 2.0, it’s a piece of cake to load local images as long as you involve the user by displaying an OpenFileDialog: OpenFileDialog ofd = new OpenFileDialog(); ofd.Filter = “JPEG Files (*.jpg;*.jpeg)|*.jpg;*.jpeg…

eBooks

Many readers have asked me if an electronic version of my book is available. Unfortunately, the answer is no and there are no plans to make one available. Some older versions of my book were available in electronic form but Microsoft Press and I discovered that many people took the file and posted it on…

Windows via C/C++ Table of Contents

Some (potential) readers have asked me to post the complete table of contents for my new Windows via C/C++ book. Here it is:   Part I Required Reading 1 Error Handling 2 Working with Characters and Strings 3 Kernel Objects Part II Getting Work Done 4 Processes 5 Jobs 6 Thread Basics 7 Thread Scheduling,…

SilverLife 2.0

Silverlight 2.0 Beta 1 shipped yesterday, so I thought now would be a good time to deploy a new version of SilverLife. SilverLife is a Silverlight implementation of John Conway’s game of Life. Version 1.0, which I published in August of last year, targeted the Silverlight 1.1 alpha. Version 2.0 targets the new Silverlight 2.0…

Sightseeing in Shanghai

I just concluded a week in Shanghai and begin the journey home tomorrow. I had the pleasure of working with a lot of very smart (and very polite) Microsoft developers in Beijing and Shanghai these past two weeks and will be bringing home a lot of fond memories. I had yesterday off, so after having a leisurely breakfast, walking…

The Travel Day from Hell

Sometimes traveling for business can be fun. As part of my job, I’ve been able to travel all over this wonderful planet. On my business trips I’ve gotten to see great sites like the Great Wall of China, Golconda Fort in Hyderabad, India, Old Jerusalem in Israel, Petra in Jordan, the Alps in Switzerland, and…

Mousewheel Zooms in Silverlight 1.1

Yesterday I was asked how one can do mousewheel zooms in Silverlight 1.1 given that 1.1 doesn’t provide any mechanism for registering managed handlers for mousewheel events. It can still be done, thanks to the fact that Silverlight 1.1 permits managed methods to be called from JavaScript. Here’s an example. Start with a XAML file…

CLR via C# will NOT be updated for .NET 3.5

I get a lot of e-mails asking me if I will be updating my CLR via C# book for .NET 3.5. This blog entry will asnwer this question. Here is the short answer: NO, I am not updating the book. Here is the long answer: My CLR via C# book was last updated for .NET 2.0 and I…

Sights and Sounds of Beijing

I arrived in Beijing last night for the start of a two-week stint in China. This morning I spent a few hours sightseeing. Work doesn’t start until tomorrow, and I figured that rather than spend the day in the hotel room, I should get out and sample the sights and sounds of Beijing. I started out in…

Eight Weeks of PowerShell

As I wrote a little bit ago my New Year’s resolution was to see if I could make PowerShell my full time command shell. The good news is that after eight weeks, I’m still using PowerShell and enjoying it. As I still have fifteen years of CMD/4NT barnacles to scrape off, I still get tripped…

Silverlight, SOHCAHTOA, and Me

My newest Wicked Code column in MSDN Magazine is now online. The title is “Silverlight Tips, Tricks, and Best Practices,” and it contains useful information for building better Silverlight apps. I previewed one of the topics discussed in the column in an earlier blog post. Now you can read all about it and download the sample code,…