You are typecasting a MainViewModel (the DataContext of the MainView) to a CreateUniversityViewModel, but there is no inheritance relation nor a conversion operator between them. If you want to end up in your null reference check, you need to
convert differently:
protected override void OnNavigatedTo(NavigationEventArgs e)
{
var viewModel = DataContext as CreateUniversityViewModel;
if (viewModel != null)
{
viewModel.LoadData();
}
}