Pagecontainer: Correctly identify the current page as a dialog

Fixes gh-7538