I would create a property on the start page of type "Page", which means that the property will be of type PageReference. Then it is no longer hardcoded.
It is also common to move such βsettingsβ properties to a separate type of settings page, which itself is connected through a property from the root or the initial page (which are constants).
I am writing from memory, so I apologize for any errors in the code.
var startPage = DataFactory.Instance.Get<StartPage>(PageReference.StartPage); var settingsPage = DataFactory.Instance.Get<SettingsPage>(startPage.SettingsPage); var blogPageRef = settingsPage.BlogPage;
If SettingsPage and BlogPage are defined
public virtual PageReference xxxPage {get; set; }
in your page type class.
source share