You can obtain the UIAbilityContext from a UIAbility or page. For details, Obtaining the Context of UIAbility.