h1

Moving My Blog

December 9, 2008

That’s right. I’ve decided to move my blog to http://www.cplotts.com. See you on the other side.

h1

Ctrl-K, Ctrl-D: Reformatting XAML in VS 2008

October 1, 2008

StackOverflow is continuing to prove its usefulness. Today, I ran across a post about reformatting xaml. Being very meticulous (ok, obsessive/compulsive <grin>) about this sort of thing, it caught my eye.

One of things, I have loved Kaxaml for is its xaml scrubber (formatter).

However, I have always wanted to have this ability in Visual Studio. Well, you do (at least in VS 2008, I haven’t checked VS 2005). Check out Laurent’s blog post on it.

h1

StackOverflow

September 30, 2008

I just stumbled into this great question and answer site (http://stackoverflow.com) for software, programming related questions.

I wonder if it is going to rival Code Project and the forums in its usefulness.

And if you are interested in my involvement, this is me on the site.

Update:

Rudi Grobler has a good post about what StackOverflow is. He is also an active WPF poster there.

h1

Dr. WPF & Namescopes

September 26, 2008

Ok, let me first say that Dr. WPF is my hero. Not just because of his WPF snippet library. But especially because of his community involvement in the WPF forum.

Today, I was wracking my brain against a problem that I’ve never run into before and … and it was Dr. WPF to the rescue (via the forum).

The Problem:

I have a custom control that I was retemplating with a fancy, schmancy template. This ControlTemplate had a Resources section where I had a couple Storyboards which were targeting items in the visual tree of the fancy template. I was also launching this Storyboard from the code for the custom control.

However for some reason, it couldn’t resolve the Storyboard.TargetName(s). It kept coming back with the error: ‘<Storyboard.TargetName>’ name cannot be found in the name scope of ‘<Namespace.CustomControl>’.

(This is where the hair pulling happened.)

The Solution:

After some research: here, here, and here … I stumbled across Dr. WPF’s forum answer on the matter. That led me to look very closely at how I was calling the Begin on the Storyboard.

Here is the old and bad code:

And, here is the good code:

What did I do differently? Well, I had always thought that the argument to the Begin method above was an object containing the items that are being targeted by the Storyboard … and that is what the IntelliSense parameter tends to suggest (containingObject) …

However, looking closer at the documentation on the parameter it says: An object contained within the same name scope as the targets of this Storyboard’s animations. Ah, ha!

After that, all I had to do was grab one of the elements in the visual tree (_button in the above code snippet) and pass that to the Begin method (whereas before I was just passing the custom control instance in, the ‘this’ in the first code snippet above).

And all of this is due to a friendly answer by the good doctor.

Thanks Doc!

Update:

I think there is another and better way to solve this problem. Check out this question/answer on StackOverflow. Bascially, there is an overload to the Begin method that lets you send in the control template. Nice. Don’t know how I missed that overload.

h1

Multi-Input Shader Effects

September 26, 2008

Greg Schechter is continuing is series on shader effects … with his latest post being on multi-input shader effects.

Robby Ingebretsen has a great post on how useful these effects could be.

It is a great time to be a user interface centric developer in Microsoft technologies.

h1

Encodings Matter with .fx Files

August 22, 2008

I was tearing my hair out, trying to figure out why my .fx file wasn’t compiling with fxc.

Eventually I figured out that if I saved the .fx file with a text editor (TextPad), fxc would just work … (previously I was saving this file using Visual Studio).

Ok, by chance I ran across Pavan Podila’s post on the matter. Ah, that’s why!

Apparently, the default encoding for text files is Unicode (UTF-8 with signature) – Codepage 65001 … and apparently fxc doesn’t compile .fx files if they have his encoding.

Argh! Wish I had seen that post sooner.

Some good news on the matter, however, is that the Visual Studio templates that Greg Schechter has posted on his blog … set the encoding to Western European (Windows) – Codepage 1252 … which does compile.

So, if you use these templates, you won’t have to think about it … which is a good thing.

h1

.NET 3.5 SP1 and Visual Studio 2008 SP1 Released

August 21, 2008

A few days late, but hey … now the capability to do all those GPU based effects … is released:

A few posts covering the release:

I’m personally going to be checking out D3DImage. If I recall correctly, this baby wasn’t in the beta.

h1

The Doctor’s Medicine

August 7, 2008

I just have to point people in the direction of Dr. WPF and his WPF snippet library. They just rock. Period.

Download them and try them out. They will save you tons of time.

h1

So Cool: GPU Based Effects in WPF

May 14, 2008

I just have to blog about this … although there must be a million other things that I would like to blog about. (Where do people find the time?)

With the service release of .NET 3.5 (now in beta), you can program effects that will run on the GPU. This means all the coolness, none of the badness (slow performance).

Greg Schechter is running a series of blog posts to introduce people on how to create these effects.

Channel 9 also recently had a great video by David Teitlebaum covering some of the new graphics capabilities (including GPU rendered effects) with the soon-to-be-release .NET 3.5 SP1.

Here are some more posts on .NET 3.5 SP1:

I can’t wait to see the effects that are going to come out of the WPF community.

Very cool news indeed.

Cory

h1

Hello, World!

April 9, 2008

Shouldn’t every good effort in technology … begin with ‘Hello, World!’

My blog has started. Let’s see where this takes me.