Oh dear - you've hit a fairly common problem here, and it's to do with the way WPF generates a backing class to actually map your controls in (it's called xxxx.g.cs where xxx is your class). You need to do a bit of work to get round this, and
here's[
^] a link to an entry you might find useful.