public PlayerSearchViewModel(IPlayerProvider playerProvider) { _view = new MyCollectionViewGeneric <IPlayer>(CollectionViewSource.GetDefaultView(playerProvider.GetAllWorldCupPlayer())); _view.Filter += (object item) => { if (_textsearch == null) { return(true); } var itemPl = (IPlayer)item; return(itemPl.Name.Contains(_textsearch) || itemPl.NationalTeam.Contains(_textsearch) || itemPl.Club.Contains(_textsearch) || itemPl.Championship.Contains(_textsearch)); }; }