How can I data bind a list of strings to a ListBox in WPF/WP7?
If simply put that your ItemsSource is bound like this: YourListBox.ItemsSource = new List<String> { “One”, “Two”, “Three” }; Your XAML should look like: <ListBox Margin=”20″ Name=”YourListBox”> <ListBox.ItemTemplate> <DataTemplate> <StackPanel Orientation=”Horizontal”> <TextBlock Text=”{Binding}” /> </StackPanel> </DataTemplate> </ListBox.ItemTemplate> </ListBox> Update: This is a solution when using a DataContext. Following code is the viewmodel you will be … Read more