private void SearchCommand_Execute(object obj) { //LucceneTest test = new LucceneTest(); //test.BuildIndex(); //var res = test.Search(SearchString); //MessageBox.Show(res); if (string.IsNullOrEmpty(SearchString)) { return; } var documentDataList = _searchManager.Search( new SearchContext { SearchString = SearchString, IndexPath = ConfigurationManager.AppSettings["IndexLocation"], ScanPath = ConfigurationManager.AppSettings["DataLocation"], SelectedSearchFilterData = SelectedSearchFilter }); Dispatcher.CurrentDispatcher.Invoke(() => { SearchResultsCollection?.Clear(); if (documentDataList != null) { SearchCount = documentDataList.Count; } foreach (var docData in documentDataList) { SearchResultsCollection.Add(docData); } }); //_synchronizationContext.Send((t) => //{ // SearchResultsCollection?.Clear(); // if (documentDataList != null) // SearchCount = documentDataList.Count; // foreach (var docData in documentDataList) // { // SearchResultsCollection.Add(docData); // } //}, null); }
private void ClearFunc() { TimerForCarAnimation.Stop(); routeResult.Locations.Clear(); routeResult.ManeuverPointsForDegreesAnimation.Clear(); routeResult.RoutePathForDegreesAnimation.Clear(); routeResult.Distance = 0; routeResult.Duration = 0; if (SearchResultsCollection != null) { SearchResultsCollection.Clear(); } DriverWaiting = true; myMap.Focus(); myMap.Children.Clear(); myMap.Children.Add(UserLocationPushpin); AddDriversToMapService.AddDriversOnTheMap(myMap, DriversRepo.GetDrivers()); }
private void ClearFunc() { TimerForCarAnimation.Stop(); routeResult.Locations.Clear(); routeResult.ManeuverPointsForDegreesAnimation.Clear(); routeResult.RoutePathForDegreesAnimation.Clear(); routeResult.Distance = 0; routeResult.Duration = 0; if (SearchResultsCollection != null) { SearchResultsCollection.Clear(); } TempIndexForLocationCollection = 0; DriverWaiting = true; MyMap.Focus(); MyMap.Children.Clear(); MyMap.Children.Add(new Pushpin() { Location = GetCurrentLocationService.CurrentLocation() }); AddDriversToMapService.AddDriversOnTheMap(MyMap, DriversRepo.GetDrivers()); }