public void SetItems(IEnumerable <object> items, Func <object, string> labelFunc, Func <object, string> textFunc) { this.textFunc = textFunc; if (items == null) { adapter.UpdateList(Enumerable.Empty <string>(), labelFunc); } else { adapter.UpdateList(items.OfType <object>(), labelFunc); } }