void SavePageFrameState()
{
var body = _view.GetPageBody();
Debug.Assert(body!=null, "(Debug Only) no body when doing SavePageFrameState()" );
// not worth crashing over a timing problem that means we don't save zoom state
if (body == null)
return; // BL-3075, not sure how this can happen but it has. Possibly the view is in some state like about:null which has no body.
var styleAttr = body.Attributes["style"];
if (styleAttr == null)
return;
var style = styleAttr.NodeValue;
var match = Regex.Match(style, "scale\\(([^,]*),");
if (!match.Success)
return;
var pageZoom = match.Groups[1].Value;
if (pageZoom != Settings.Default.PageZoom)
{
Settings.Default.PageZoom = pageZoom;
Settings.Default.Save();
}
}