0
NavigatorItem NavItem = (NavigatorItem)cboItems.SelectedItem;
lblTitle.Text = NavItem.Title;
RadWrapPanel Panel = new RadWrapPanel();
Type t = NavItem.ItemsType; //<------ The Type inside my List is here.
List<???> items = (List<???>)NavItem.Items; // <----Here Is the problem
foreach (object item in items)
{
Panel.Children.Add((UIElement)Activator.CreateInstance(NavItem.Display,item));
}
ItemsContainer.Content = Panel;
在上面的代碼中,我需要獲取t變量上的項目類型以便放入我的泛型列表中。我可以按類型轉換通用列表嗎?
請幫忙!!!
解決了感謝的人! – JoeLoco 2010-09-18 12:07:34