/// <summary> /// Removes marked survey from list you want to search by. /// </summary> /// <param name="item"></param> public void RemoveSelectedSurvey(SurveyBasicInfo item) { if (item.SurveyId != "0") { SelectedSurveys.Remove(item); } if (SelectedSurveys.Count == 0) { SelectedSurveys.Add(AllSurveysItem); } }
/// <summary> /// Adds selected survey to list you want to search by. /// </summary> /// <param name="avaiableSurveys">List of surveys currently saved in IsolatedStorage.</param> public void AddChosenSurvey(ObservableCollection <SurveyBasicInfo> avaiableSurveys) { int selectedIndex = Convert.ToInt32(ChosenSurvey); if (selectedIndex != avaiableSurveys.Count) { SurveyBasicInfo selectedItem = avaiableSurveys[selectedIndex]; if (!SelectedSurveys.Contains(selectedItem)) { SelectedSurveys.Add(selectedItem); } if (SelectedSurveys.Count > 1) { SelectedSurveys.Remove(AllSurveysItem); } } else { SelectedSurveys.Clear(); SelectedSurveys.Add(AllSurveysItem); } }