WPF ListBox Data Binding

Add Items Of List With Their Names

We assume that you have a list. And you want to display it to a ListBox in the WPF what with their names or other one specific wishes. You will see your specific item name. Maybe you click to it and list of all contents of list elements.

YourApp.xaml

<ListBox ItemSource = "{Binding .}">
 <ListBox.ItemTemplate>
  <DataTemplate>
   <TextBlock Text="{Binding nameOrYourSpecificWishes}"/>
  </DataTemplate>
 </ListBox.ItemTemplate>
</ListBox>

Comments

Popular posts from this blog

CIFAR-10 Dataset Classification Using Convolutional Neural Networks (CNNs) With PyTorch

Radial Basis Function Networks with PyTorch

Long-short-term-memory (LSTM) Word Prediction With PyTorch