private void SelectScreenLoadedHandler(object sender, RoutedEventArgs e) { CheckDisposedState(); ThumbnailList list = _selectScreen.ListControl.List; if (ExecutionEngine.Context.Contains(Constants.PhotosToRemove)) { System.Collections.Generic.List <string> filesToRemove = (System.Collections.Generic.List <string>)ExecutionEngine.Context[Constants.PhotosToRemove]; list.Items. Where(item => filesToRemove.Contains(item.Photo.SourceFileName)). ToList(). ForEach(item => list.RemoveItem(item, false)); ExecutionEngine.Context.Remove(Constants.PhotosToRemove); } if (ExecutionEngine.Context.Contains(Constants.FoundPhotos)) { var foundPhotos = (System.Collections.ObjectModel.Collection <PhotoItem>)ExecutionEngine.Context[Constants.FoundPhotos]; var newPhotosList = foundPhotos.Where(photo => !list.Items.Any(item => photo.SourceFileName.Equals(item.Photo.SourceFileName))).ToList <PhotoItem>(); var newPhotosCollection = new System.Collections.ObjectModel.Collection <PhotoItem>(newPhotosList); list.LoadItems(newPhotosCollection); ExecutionEngine.Context.Remove(Constants.FoundPhotos); } }
public AsyncThumbnailsLoader(IList <ThumbnailItem> itemsList, ThumbnailList list) { _thumbnailItems = itemsList; _thumbnailList = list; _workerThread = new QueueProcessingThread(ThreadPriority.BelowNormal, Thread.CurrentThread); ExecutionEngine.EventLogger.Write("AsyncThumbnailsLoader created"); }
public ThumbnailListControl(string styleName) { InitializeComponent(); _filterTabs = new List <FilterTab>(); _showEmptyFilterTabs = true; _list = new ThumbnailList(styleName, this); Binding thumbListBinding = new Binding(); thumbListBinding.Source = _list.VisibleItems; _thumbListbox.SetBinding(ListBox.ItemsSourceProperty, thumbListBinding); _thumbListbox.ItemContainerStyleSelector = new SeparatorStyleSelector(_list); if (_listBoxHolder is IScrollInfo) { ((IScrollInfo)_listBoxHolder).CanHorizontallyScroll = true; ((IScrollInfo)_listBoxHolder).ScrollOwner = _scrollViewer; } _list.ItemChanged += new EventHandler(ListItemContentChangedHandler); }
public SeparatorStyleSelector(ThumbnailList list) { _list = list; }