public MainWindowSearch() { // Required to initialize variables InitializeComponent(); proxy = new WebServiceClient(); tmpSelectedList = new List<SearchableData>(); dataSet = new RequirementsAndPatternsAndCategoriesAndPrivRequirements(); searchResult = new List<Data.SearchableData>(); proxy.getAllDataCompleted += new EventHandler<getAllDataCompletedEventArgs>(proxy_getAllDataCompleted); proxy.toggleActiveRequirementCompleted += new EventHandler<toggleActiveRequirementCompletedEventArgs>(proxy_toggleActiveRequirementCompleted); proxy.toggleActivePrivateRequirementCompleted += new EventHandler<toggleActivePrivateRequirementCompletedEventArgs>(proxy_toggleActivePrivateRequirementCompleted); textChangedEventHandler = new TextChangedEventHandler(searchString_TextChanged); searchString.TextChanged += textChangedEventHandler; getAllSearchData(); //Hide info panels hideInfoPanels(); }
void proxy_getAllDataCompleted(object sender, getAllDataCompletedEventArgs e) { try{ dataSet = e.Result as RequirementsAndPatternsAndCategoriesAndPrivRequirements; //update requirement list int selItem = leftList.SelectedIndex; dataSetSearchable = populatePrivateRequirements(); dataSetSearchable.Sort(delegate(Data.SearchableData d1, Data.SearchableData d2) { return d1.Priority.CompareTo(d2.Priority); }); leftList.ItemsSource = dataSetSearchable; if (selItem == -1 && dataSetSearchable.Count > 0) leftList.SelectedIndex = 0; else leftList.SelectedIndex = selItem; ProgressBar.Visibility = Visibility.Collapsed; } catch(Exception){ ProgressBar.Visibility = Visibility.Collapsed; } }
void proxy_getAllDataCompleted(object sender, getAllDataCompletedEventArgs e) { try { dataSet = e.Result as RequirementsAndPatternsAndCategoriesAndPrivRequirements; populateSearchResult(); updateSearchList(); } catch (Exception) { ProgressBar.Visibility = Visibility.Collapsed; } }