예제 #1
0
 public ImageListVm()
 {
     SearchCommand      = new ReactiveCommand <object, object>((x) => !IsBusy);
     UILoadedCommand    = new ReactiveCommand <object, object>((x) => !IsBusy);
     ListImageEntityObj = new RangeEnabledObservableCollection <ImageEntityVm>();
     LoadImages();
     WireupViewModelStreams();
 }
예제 #2
0
        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;
        }
예제 #3
0
        public MainVm()
        {
            if (ListImageEntityObj == null)
            {
                //if (ListImageEntityObj.Count > 0)
                //{
                ListImageEntityObj = new RangeEnabledObservableCollection <ImageEntity>();
                ProgressValue      = 0;
                //ListImageEntityObj = new ObservableCollection<ImageEntity>(ImageView.GetAllImageData().Result);
                //}
            }

            DoAsync(() => LoadImages());
        }
예제 #4
0
        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;
        }