Tech
Forums
Jobs
Books
Events
Live
Interviews Prep
More
Learn
Training
Career
Members
Videos
News
Blogs
Login
Sign Up
Ask Question
1
Reply
Listbox selectionchange event problem
burak seyhan
Sep 19 2015 11:38 AM
429
Reply
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 ?
Upload Source Code
Select only zip and rar file.
Post
Reset
Cancel
Answers (
1
)
Next Recommended Forum
WPF percentage status shown in label MVVM
Make dynamic Language header on datagrid