TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Burak Seyhan
NA
321
30.1k
Listbox selectionchange event problem
Sep 19 2015 11:38 AM
Hi ,
I wan to learn something
This is my xaml page code.
<ListBox x:Name="listBox" HorizontalAlignment="Left" Height="227" Margin="10,25,0,0" VerticalAlignment="Top" Width="184" SelectionChanged="listBox_SelectionChanged">
<ListBox.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding Name}"/>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
then C# code is
List<Product> products = new List<Product>();
products.Add(new Product() { Id = 1, Name = "Test" });
products.Add(new Product() { Id = 1, Name = "Test" });
products.Add(new Product() { Id = 1, Name = "Test" });
products.Add(new Product() { Id = 1, Name = "Test" });
listBox.ItemsSource = products;
I want to selectionchange event but always get null data can you help me ?
Reply
Answers (
1
)
Newbie needs help with c# and automating a wpf application
Make dynamic Language header on datagrid