Moved the code that checks for the password file to the Page_Loaded event. this.Frame.Navigate doesn't work properly when called from a constructor.