private WindowPosition _ReadWindowPositionFromXml(XmlReader xml)
        {
            var wp = new WindowPosition();

            try
            {
                while (xml.Read())
                {
                    if (xml.NodeType == XmlNodeType.Element)
                    {
                        var name = xml.Name;
                        if (name == XmlNodes.WindowPositionLeft)
                        {
                            var s = xml.ReadString();
                            var d = XmlConvert.ToDouble(s);
                            wp.Left = d;
                        }
                        else if (name == XmlNodes.WindowPositionTop)
                            wp.Top = XmlConvert.ToDouble(xml.ReadString());
                        else if (name == XmlNodes.WindowPositionWidth)
                            wp.Width = XmlConvert.ToDouble(xml.ReadString());
                        else if (name == XmlNodes.WindowPositionHeight)
                            wp.Height = XmlConvert.ToDouble(xml.ReadString());
                        else if (name == XmlNodes.WindowPositionIsMaximized)
                            wp.IsMaximized = XmlConvert.ToBoolean(xml.ReadString());
                    }
                }
            }
            catch
            {
                wp = null;
            }
            finally
            {
                xml?.Close();
                xml?.Dispose();
            }

            return wp;
        }