I just finished speaking at Microsoft’s WPF Bootcamp in Redmond, WA. My topic was how to design, implement, and unit test WPF applications. I focused on using the Model View Controller pattern, as well as how to write unit tests for the Model and Controller. In about a month or so, a video recording of the entire WPF Bootcamp will be put on the Web. When that happens, I’ll let you know.
The presentation went very well and many people in the audience asked if I could get the demo app source code to them as soon as possible. Instead of waiting for the bootcamp’s material to be released, I decided to host it here on my blog. You can download both the PowerPoint slides and the entire demo app (which requires Visual Studio 2008) here: WPF Bootcamp Presentation (2008)
NOTE: You need to change the download’s file extension from .DOC to .ZIP and then decompress it. This is a workaround for a limitation imposed by WordPress.
Thanks to everyone in the audience who asked those interesting and important questions. That really added to my material. 🙂
I have met many of the WPF biggies while out here. I enjoyed lunch with Rob Relyea and Dr. WPF while discussing the future of WPF, and right now I’m sitting next to Karsten Januszewski and Jaime Rodriguez! It’s great to finally meet the people whose blogs have shaped my thinking about WPF, and whose forum posts have shown me the framework in such great detail.
By the way, I had no idea how popular Mole is becoming! Holy smokes! It turns out that Mole is making big waves at Microsoft. I love knowing that our hard work and dedication has had such a profound and positive impact on the .NET world! 😀
Hacks are usually the result of working around a bug or artificial limitation in some library against which you are coding, but have no ability to modify. I typically try to brush my hacks and workarounds under the rug, hoping no one will ever see them. But today I am proud to announce a hack I came up with. This is, in my opinion, one of the few hacks worth its weight in digital gold.
Karl Shifflett and I were talking on the phone yesterday. He mentioned that he has received a lot of support e-mails on email@example.com where people are confused about how to open Mole. Several people have tried to view an object in Mole that wasn’t “moleable,” meaning that the Mole.Visualizer.dll assembly is not decorated with an instance of the DebuggerVisualizer attribute where the target type is the type of object (or ancestor type) they want to molenate. In other words, people have been trying to open Mole on a business object they created, but Visual Studio does not list Mole as an available visualizer for that object.
Team Mole has known about this issue for a long time. The crux of the matter is that Visual Studio will not allow us to apply the DebuggerVisualizer attribute to Mole and specify that it works for any object that descends from System.Object. Visual Studio does not want to show Mole as an available visualizer for any type of object, but that is exactly what we want it to do. Yesterday I figured out a simple way to work around this artificial limitation imposed by Visual Studio. Karl has since dubbed it “The Rock Star Hack of 2008” since my nickname is Rock Star (more on that here).
Visual Studio has no qualms with allowing us to specify that Mole can be used to visualize a System.WeakReference object. Since WeakReference is basically just a thin wrapper around any object, we use WeakReference as a Trojan horse to smuggle any object past the Visual Studio sentries and into Mole. Once Mole gets a hold of the WeakReference we wrapped around the object that we actually want to visualize, it unwraps the object and displays it in the UI, throwing away the WeakReference in the process. Keep in mind that we are only using WeakReference as a container to smuggle any object into Mole, we are not using that class for its intended and documented purpose.
So that’s all well and good, but it would be a real nuisance if you had to stop your debugging session just to edit your code and create these WeakReferences for Mole, wouldn’t it? That’s where the Watch window enters the picture. You can create a WeakReference in the Watch window, and pass the object to visualize into its constructor. Here’s an example of how I used this feature to open Mole on Podder‘s main data model class instance:
Once the WeakReference has been created in the Watch window, I can simply click on the magnifying glass icon to open Mole. Bear in mind that this code is executing in the application’s data model assembly, which has no UI controls or anything else that you typically use to open Mole. Before this hack was invented, using Mole in this situation was impossible. How cool is that?!
Karl posted this video on YouTube showing how to use The Rock Star Hack of 2008:
I am thrilled to announce that Grant Hinkson, visual designer extraordinaire, has agreed to create a new skin for Podder! I have the utmost respect for Grant’s talents as a visual designer, his imaginative use of visual effects, and his expertise in WPF. I can’t wait to see how good Podder will look once he is finished with it.
I thought it was a long shot when I asked Grant if he would be interested in working on my side project, because I know he is a very busy person, but he was just as excited as I am about working on Podder. It is great working with passionate people! I feel that the Podder project has now gone from being cool to phenomenally cool.
Here is a little background info on Grant, in case you are curious:
If you are interested in cutting edge .NET technology you probably have heard of Sacha Barber. His tour de force on the CodeProject is impressive, to say the least. He is a Microsoft MVP, a CodeProject MVP, and a .NET 3.5 expert. My kind of guy! 😀
I had the pleasure of meeting Sacha recently, while his girlfriend and he were on vacation in New York City. Actually, we had such a great time hanging out that we got together again before they returned to England. Sacha is not only a .NET rock star, but also a very nice and fun guy to hang out with. His girlfriend, Sarah, is top notch, too.
Here are some pictures of two .NET alpha geeks (and a lovely English lady) hanging out together, drinking, eating, and enjoying life. Click on the pictures to view them at full size.
Sacha, Sarah, and me enjoying yummy mojitos at Bluesmoke
Sacha and me enjoying mojitos at Bluesmoke
Sacha and me drinking beer at Heartland Brewery
Me and Sacha eagerly awaiting the chance to eat more ribs, at Bluesmoke
In my previous post I took a little break from WPF to post a recording of me playing a Bach composition on the piano. I’m having too much fun to stop! I made another recording, this time it’s the Prelude to Bach’s first keyboard partita, in B-flat major. For some reason, toward the end of this recording it sounds a little strange, like someone passed it through a wah-wah pedal. Oh well…enjoy!
I meet a lot of people who are into WPF. It’s funny how many of them are interested in the fact that I play Johann Sebastian Bach‘s keyboard music on the piano. Bach has been an obsession of mine since I was a little kid. I’ve been playing the piano since I was five years old, and have been in love with Bach’s music since around then.
Quite a few people have asked me to send them a recording of me playing a Bach piece. I have a Yamaha Clavinova CLP 240, which is a fantastic digital grand piano. Recently I realized that I can create semi-decent recordings of me playing the piano and then save them as MP3 files. So I decided to satisfy the curiosity of all those people who, for whatever strange reason, want to hear me play some Bach.
I wish I had more time to practice the piano, but being obsessed with WPF kinda gets in the way. The performance is pretty good, but there are definitely things about it I would like to improve. Unfortunately I’m not sophisticated enough at this stuff to figure out how to edit the audio file. 😉 Alright, enough excuses for my shortcomings. Here is a recording of me playing the Rondeaux from Bach’s second keyboard partita, in C minor: Rondeaux in C minor (as played by Josh)