This seems like rather too much nesting:

using (XmlReader reader = XmlReader.Create(filename))
{
    while (reader.Read())
    {
        if (reader.IsStartElement())
        {
            switch (reader.Name)
            {
                case "Width":
                    map.Width = ParseXMLValue(reader);
                    break;
                case "Height":
                    map.Height = ParseXMLValue(reader);
                    break;
                case "TileSize":
                    map.TileSize = ParseXMLValue(reader);
                    break;
                case "Layers":
                    map.LayerCount = ParseXMLValue(reader);
                    break;
                case "Layout":
                    ParseLayout(reader);
                    break;
                case "Layer":
                    currentLayerIndex = ParseLayer(reader);
                    break;
                case "CollisionLayer":
                    currentLayerIndex = ParseCollisionLayer();
                    break;
                case "Row":
                    ParseRow(reader);
                    break;
            }
        }
    }
}


This is ParseXMLValue(reader):

private int ParseXMLValue(XmlReader reader)
{
    reader.Read();

    return int.Parse(reader.Value);
}


I'm new to reading XML in C#. Surely there is a better way?


Question: how to stop my html page resize
Answer: The only way to handle this is with script.  Take a look at other examples where people float a footer at the bottom of the page for example.

Using jQuery you might do something like:- 

&lt;script type="text/javascript"&gt;
$(document).ready(function() { setPanels(); });
window.onresize = function() { setPanels(); }

function setPanels() {
    var windowHeight = $(window).height();
    var content1Height = $('#topDiv').height();
    var content2Height = $('#bottomDiv').height();

    // Now calculate the new splits and adjust heights
    ...

&lt;/script&gt;