you have to rotate the xgraphics object.
Code:
gfx.RotateAtTransform(90, new XPoint(page.Width / 2, page.Height / 2));
the problem is then you are rotating around the wrong point since you are now in landscape. So you need to measure the difference between the center point of the document when in landscape and portrait
Code:
var offset = Math.Abs((page.Height - page.Width))/2;
then shift the document to adjust for the center points
Code:
gfx.TranslateTransform(offset, -offset);
This was from landscape to portrait so you may need to adjust the TranslateTransform. it could be
Code:
gfx.TranslateTransform(-offset, offset);