protected override void OnNavigatedTo(NavigationEventArgs e) { base.OnNavigatedTo(e); _viewmodel = new ViewModel(); _viewmodel = (ViewModel)e.Parameter; pageRoot.DataContext = _viewmodel; loadcontent(); }
protected override void OnNavigatedTo(NavigationEventArgs e) { base.OnNavigatedTo(e); _viewmodel = new ViewModel(); _viewmodel = (ViewModel)e.Parameter; pageRoot.DataContext = _viewmodel; questioncontent = _viewmodel.one.strQuestionTitle + "\n\n" + _viewmodel.one.strQuestionContent + "\n\n" + _viewmodel.one.strAnswerTitle + "\n\n" + _viewmodel.one.strAnswerContent; loadquestion(); }
protected override async void OnNavigatedTo(NavigationEventArgs e) { base.OnNavigatedTo(e); date = (string)e.Parameter; //date = "2015-07-17"; viewModel = new ViewModel(date); bool flag = await viewModel.LoadData(); if(flag == true) { pageRoot.DataContext = viewModel; } else { MessageDialog dialog = new MessageDialog("无网络连接"); await dialog.ShowAsync(); } }