Most of my experience is with VBA, but I believe you could do something like this to always get the result in millimeters across your devices:
_pageHeight = Convert.ToDouble(_page.PageSheet.Cells["PageHeight"].Result(visMillimeters).Replace(" mm.", ""));
The constant visMillimeters I'm getting from the documentation here: https://docs.microsoft.com/en-us/office/vba/api/visio.visunitcodes
Hope this helps.