The Coding Humanist

Archives: 2/2007

DesignMode Property for WPF

-- Filed Under: Winforms, WPF
Comments: (0)

A very useful property for visual elements that you wanted to use in a designer in Visual Studio in Winform development was the DesignMode property of Component. That allowed you to make conditional code that wouldn't have the proper context to run in a design mode environment.

It is not immediately obvious how to do that in WPF, because it doesn't show up in the intellisense where you would expect it. But, it is still there. It is a little less convenient, but no worries. A check would look something like this:

bool foo = System.ComponentModel.DesignerProperties.GetIsInDesignMode(this);

That boolean value would indicate whether or not you were in design mode. A lot more verbose, but still workable. 

Code Thought of the Day

-- Filed Under: Development, Books
Comments: (0)

Last week the guest on DotNetRocks was Steve McConnell, author of Code Complete. I had read about 2/3 of the first edition and liked it, so I wanted to get the new edition and read it. My team lead was nice enough to buy it for me and expense it, so I am reading it now. Here's a thought that is often so true. Many businesses Every business I've worked at since my foray into full-time software development could learn from this:

"In many projects, the only documentation available to programmers is the code itself. Requirements specifications and design documents can go out of date, but the source code is always up to date. Consequently, it's imperative that the source code be of the highest possible quality."

Alas, will the world ever learn? Surely some of you have been somewhere that doesn't have this problem :) 

Me At Refresh Dallas

-- Filed Under: General
Comments: (0)

Any of you web geeks out there been to Refresh Dallas? Me either. I'm going to check it out tomorrow night. If you're going, drop me a note.

Crispy and Wheaty

-- Filed Under: General
Comments: (2)

I was in the drive through at Crispy Creme the other day and noticed that they now have whole wheat donuts. Does this strike anybody else as ironic, odd, or at least slightly off?

Taking the WPF Dive

-- Filed Under: Tech Review, WPF
Comments: (2)

So I finally started looking into WPF. I finally had a project that could use it. I've spent the last week and three days spending just about all my spare time reading and coding this stuff.

First impression...wow. Over the last few months I have been spending time in ASP.NET Ajax and have been very impressed, and I still am. But this...this just blows me out of the water. Seriously, as I do things, I keep saying "wow" to myself. I also found myself frequently bugging my personal winforms gui guru David just to say "wow" to him.

It is going to have quite the learning curve with most who have experience in winform development. That has been the case for me. It's not that it is very hard; it is just very different.

More thoughts later, for sure. The project that involves WPF will go on for quite some time. I will be able to tell you more about the specific project sometime in March, I expect. Stay tuned.

Until then, if you do any windows development, check it out. It rocks. And while you are at it, check out Expression Blend. Very useful.