public ImageListVm() { SearchCommand = new ReactiveCommand <object, object>((x) => !IsBusy); UILoadedCommand = new ReactiveCommand <object, object>((x) => !IsBusy); ListImageEntityObj = new RangeEnabledObservableCollection <ImageEntityVm>(); LoadImages(); WireupViewModelStreams(); }
private void DoLuceneSearch() { var filteredList = new RangeEnabledObservableCollection <ImageEntityVm>(); var list = LuceneService.Context.Search(SearchTerm); filteredList.InsertRange(ListImageEntityObj.Where(entity => list.Contains(entity.ImageName))); //lbImageGallery.DataContext = filteredList; }
public MainVm() { if (ListImageEntityObj == null) { //if (ListImageEntityObj.Count > 0) //{ ListImageEntityObj = new RangeEnabledObservableCollection <ImageEntity>(); ProgressValue = 0; //ListImageEntityObj = new ObservableCollection<ImageEntity>(ImageView.GetAllImageData().Result); //} } DoAsync(() => LoadImages()); }
private void SearchButton_Click(object sender, RoutedEventArgs e) { var filteredList = new RangeEnabledObservableCollection <ImageEntity>(); var list = LuceneService.Context.Search(SearchBox.Text); var listDic = list.ToDictionary(s => s.FileName) as Dictionary <string, LuceneDoc>; filteredList.InsertRange(ListImageEntityObj.Where(entity => listDic.ContainsKey(entity.CleanImageName)) .Select(s => { var item = listDic[s.CleanImageName]; s.LuceneScore = item.Score; s.LuceneRanking = GetRanking(item.Score); return(s); }) .OrderByDescending(s => s.LuceneScore)); lbImageGallery.DataContext = filteredList; }