Data binding of itemscontrol in Silverlight 3.0
        Posted  
        
            by jmkarthik
        on Stack Overflow
        
        See other posts from Stack Overflow
        
            or by jmkarthik
        
        
        
        Published on 2010-04-29T18:34:30Z
        Indexed on 
            2010/04/29
            18:37 UTC
        
        
        Read the original article
        Hit count: 146
        
silverlight-3.0
|itemscontrol
I am trying to define an itemscontrol and data bind it to a List and the code is as below. XAML
Item Class public class Item { public string val; }
XAML.cs public MainPage() { InitializeComponent();
        List<Item> items = new List<Item>();
        Item item1 = new Item();
        item1.val = "iasl;fdj1";
        items.Add(item1);
        Item item2 = new Item();
        item2.val = "iasfdkasdkljf2";
        items.Add(item2);
        ic.ItemsSource = items;
    }
The items are displayed when I run this. Am I missing something?
© Stack Overflow or respective owner