I'm all better now, ready to rock and roll
After thinking about trying to do this, I've decided to slightly simplify my goal initially, I'll use 50x50 buttons as the items in the grid, then I'll build up to using the textblocks, this way I can just use a constant 50 to begin with. Maybe that's easier, maybe it's not, I'm not sure, but it seems like it would be.
My initial thoughts on creating an app specifically to practice this are as follows (in terms of taking the first steps, I know this is not complete).
The GridManger class will contain fields such as the width/height of the items (50 in this simplified case, so I used a single Size field as opposed to two for width and height) which would translate I suppose as grid cell width and height, and the current number of columns and rows. This class will need to be able to access the width and height of the mainwindow (to know how many rows/columns there should be) and obviously the grid itself.
In the viewmodel having properties for the current width and height of the window seem necessary, not sure just yet what else would go here but I think it'll become apparent as I go on.
So from there I began to implement it and got stuck instantly
After binding the window size to the properties in the VM I made the GridManger class just as I described above and in the contructor I was going to call a method to set the number of columns and rows to be equal to the main windows size divided by 50. Maybe that's the wrong way to go about it, I don't know, but the GridManager class doesn't see the grid (MyGrid), I don't know how to resolve that and that's where I hit a wall and can't go further. My idea from there would have been to call that method again from the mainwindows resize event handler to do the same thing maintaining the right amount of rows/columns based on the window size. Or actually maybe that method call would be better placed in the VM's window width and height property setters.
I also had trouble referencing the VM's WindowHeight and WindowWidth properties from the GM. The only way I can think to let the GM class see the VM would be to pass a reference to it's contructor, but then it's scope would be restricted to the contructor, and that wouldn't be useful.
Handling scope is definitely my nemesis. I get the feeling I'm doing this quite wrong
Please don't feel any need to rush replies, I don't mind waiting.