I have a RadTabStrip control that contains: public RadTabCollection Tabs { get; } public RadTabCollection Tabs { get; } . The RadTabCollection class inherits from: public class RadTabCollection : ControlItemCollection, IEnumerable<RadTab>, IEnumerable
Now I have a list of CormantRadTab. This class inherits: public class CormantRadTab : RadTab, ICormantControl<RadTabSetting>
My goal is to populate the CormantRadTab list with RadTabCollection. Currently this is implemented:
List<CormantRadTab> oldTabs = new List<CormantRadTab>(Tabs.Count); foreach( CormantRadTab tab in Tabs) { oldTabs.Add(tab); }
It really seems to me that I can do something like:
List<CormantRadTab> oldTabs = new List<CormantRadTab>(Tabs.AsEnumerable<RadTab>());
but this does not match the overload signature expected by the new list. If I try to use AsEnumerable CormantRadTab, I get other errors.
What is the right way to do this?
source share