private void LoadStartingFromIDAction(object id) { if (!CurrentTab.IsAllTab()) { return; } uint startFromID; uint i = id is uint?(uint)id : 0; if (i == 0) { string s = id as string; if (s == null) { return; } if (!uint.TryParse(s, out startFromID)) { return; } } else { startFromID = i; } var da = CurrentTab.LoadEntries(startFromID); // let's select loaded entry if (da != null) { da.Completed += (sender, args) => { foreach (Log9KEntry entry in LogEntriesCollectionView.Cast <Log9KEntry>().Where(entry => entry.ID == startFromID)) { SelectedEntry = entry; } }; } }