public void LoadData(object data) { searchQuery = ((ColumnSearchDataHelper)data).SearchQuery; if (String.IsNullOrEmpty(searchQuery)) { messages.Clear(); documents.Clear(); persons.Clear(); statusUpdates.Clear(); return; } dock.SearchQuery = searchQuery; OnPropertyChanged("Title"); var searchMessages = ClientState.Current.Search.PerformSearch <Message>(searchQuery) .Select(id => mailbox.Messages.FirstOrDefault(m => m.MessageId == id)) .Where(doc => doc != null) .ToList(); var searchDocuments = ClientState.Current.Search.PerformSearch <Document>(searchQuery) .Select(id => mailbox.Documents.FirstOrDefault(d => d.DocumentId == id)) .Where(doc => doc != null) .ToList(); var searchPersons = ClientState.Current.Search.PerformSearch <Person>(searchQuery) .Select(id => mailbox.Persons.FirstOrDefault(p => p.PersonId == id)) .Where(p => p != null) .ToList(); var searchStatusUpdates = ClientState.Current.Search.PerformSearch <UserStatus>(searchQuery) .Select(id => mailbox.StatusUpdates.FirstOrDefault(s => s.StatusId == id)) .Where(s => s != null) .ToList(); messages.Replace(searchMessages); documents.Replace(searchDocuments); persons.Replace(searchPersons); statusUpdates.Replace(searchStatusUpdates); }