Accessing a parameter passed between UWP Pages Accessing a parameter passed between UWP Pages windows windows

Accessing a parameter passed between UWP Pages


You should save the parameter to the class field or property to have access to it:

public class EntiEdit : Page{    private string _entityId;    protected override void OnNavigatedTo(NavigationEventArgs e)     {        _entityId = e.Parameter as string;    }}

If you need to initiate some handling after navigating the page you can do it from the event handler:

protected override void OnNavigatedTo(NavigationEventArgs e) {    var entityId = e.Parameter as string;    EntityData = LoadEntity(entityId);    DoSomeOtherRoutine(entityId);}