I made a simple Window object that declared a simple list in C# code:
How to bind to 'list' object in XAML? I tried something like this:Code:List<int> list = new List<int>(); public Window1() { InitializeComponent(); list.Add(2); list.Add(3); }
But obviously I does not work. How to solve that?Code:<ListBox Name="lb" ItemsSource="{Binding Source={StaticResource list}}"> </ListBox>
Thank you for help in advance




Reply With Quote