I have this code for my very very basic WPF Project.
you have to enclose it in a ColumnDefinitions collection.
Adding row definitions works the same way.
Enjoy!