public void Remove(StreamItemViewModel item) { if (_priorityQueue.Contains(item)) { _priorityQueue.Remove(item); } if (_standardQueue.Contains(item)) { _standardQueue.Remove(item); } }
/// <summary> /// Adds a photo stream item to the rendering queue. /// /// Item's void TransitionToImage(WriteableBitmap) will be called when rendering has been completed. /// </summary> /// <param name="item">Photo stream item to add</param> /// <param name="priority">True if rendering this item is high priority, otherwise false</param> public void Add(StreamItemViewModel item, bool priority) { if (priority) { _priorityQueue.Add(item); } else { _standardQueue.Add(item); } EnsureProcessing(); }
public void Add(StreamItemViewModel item) { System.Diagnostics.Debug.Assert(_items.Count < MaxItems); _items.Add(item); item.SizeHint = ImageSize(_items.Count - 1); if (PropertyChanged != null) { PropertyChanged(this, new PropertyChangedEventArgs("Image" + _items.Count)); } }
public bool Contains(StreamItemViewModel item) { return _priorityQueue.Contains(item) || _standardQueue.Contains(item); }
public bool Contains(StreamItemViewModel item) { return(_priorityQueue.Contains(item) || _standardQueue.Contains(item)); }
private void AddItemToViewModel(StreamItemModel item) { if (_currentMosaicViewModel == null || _currentMosaicViewModel.Count == PhotoMosaicViewModel.MaxItems) { _currentMosaicViewModel = new PhotoMosaicViewModel() { StreamItemTapped = PhotoMosaicViewModel_PhotoStreamItemTapped }; ListBoxItems.Add(_currentMosaicViewModel); } StreamItemViewModel m = new StreamItemViewModel(item); //m.Render(StreamItemViewModel.Size.Small); // pre-render _currentMosaicViewModel.Add(m); }