This is code of click event of MainPage
void ItemView_ItemClick(object sender, ItemClickEventArgs e)
{
var item = ((EventItem)e.ClickedItem);
this.Frame.Navigate(typeof(EventPage), new Navigator() { Parent = "Dashboard", Event = item });
}
The sender
parameter of the loaded event is the control that raised the event (in this case, the current page); so its type is the type of the page, not Navigator
.
Apparently you're trying to access the argument that was passed to Frame.Navigate
. To do that, you should override the OnNavigatedTo
method:
protected override void OnNavigatedTo(NavigationEventArgs e)
{
var param = (Navigator)e.Parameter;
...
}