private void OnSearch(SearchPhotoEvent searchPhotoEvent) { if (_currentSearchRequestId != searchPhotoEvent.SearchId) { // remember the search that is in progress _currentSearchRequestId = searchPhotoEvent.SearchId; // // flush photos from previous search // //PhotoViewModel vm; //do //{ // vm = null; // _queuePhotoViewModels.TryDequeue(out vm); //} while (vm != null); } }
private void OnSearchPhoto(SearchPhotoEvent searchPhotoEvent) { // update the search request if it is a new one if (_searchRequest.SearchRequestId != searchPhotoEvent.SearchId) { lock (_searchRequest.SynLock) { _searchRequest.SearchRequestId = searchPhotoEvent.SearchId; _searchRequest.SearchTerm = searchPhotoEvent.SearchTerm; _searchRequest.IsUpdated = true; } } if (! IsRunning) Resume(); }