locked
Universal App Sqlite

Answers

  • 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();
        }
    }

    Monday, June 30, 2014 6:51 AM