/// <summary> /// Default constructor. /// </summary> public ListOfSurveysViewModel() { List = new ObservableCollection<SurveyBasicInfo>(); DownloadStatus = new DownloadListStatus(); Connection = new TestConnection(); _operations = new OperationsOnListOfSurveys(List, DownloadStatus); }
/// <summary> /// Default constructor. /// </summary> public ListOfNewSurveysViewModel() { List = new ObservableCollection<SurveyBasicInfo>(); DownloadListStatus = new DownloadListStatus(); Operations = new OperationsOnListOfSurveys(List, DownloadListStatus); DownloadSurveysStatus = new DownloadSurveysStatus(); }
private void OnFavorite(object sender, EventArgs e) { OperationsOnListOfSurveys op = new OperationsOnListOfSurveys(new ObservableCollection<SurveyBasicInfo>(), new DownloadListStatus()); //remove from favorite surveys if (Convert.ToBoolean(_viewModel.IsFavorite)) { op.RemoveFromFavorite(_viewModel.SurveyId); _appBarFavorite.IconUri = new Uri("/View/icons/AddFavoriteIcon.png", UriKind.Relative); _appBarFavorite.Text = Languages.AppResources.surveyPageAppBar_AddToFavorite; _viewModel.IsFavorite = "false"; } //add to favorite surveys else { op.AddToFavorite(_viewModel.SurveyId); _appBarFavorite.IconUri = new Uri("/View/icons/RemoveFavoriteIcon.png", UriKind.Relative); _appBarFavorite.Text = Languages.AppResources.surveyPageAppBar_RemoveFromFavorite; _viewModel.IsFavorite = "true"; } }
private void OnDeleteSurvey(object sender, EventArgs e) { YesNoMessageBox messageBox = new YesNoMessageBox(); messageBox.Title = Languages.AppResources.surveyPage_deleteSurveyDialogTitle; messageBox.Message = Languages.AppResources.surveyPage_deleteSurveyDialogMessage; messageBox.Completed += (object YesNosender, EventArgs args) => { if (((YesNoMessageBox)YesNosender).Response == YesNoMessageBox.MessageResponse.Yes) { try { OperationsOnListOfSurveys op = new OperationsOnListOfSurveys(new ObservableCollection<SurveyBasicInfo>(), new DownloadListStatus()); op.Delete(_viewModel.SurveyId); NavigationService.GoBack(); } catch (IsolatedStorageException) { MessageBox.Show(Languages.AppResources.surveyPage_deleteSurveyError); } } }; messageBox.Show(); }