Skip to main content
fixed missing quote
Source Link

You can do this by modifying the ItemsTemplate

 <ListBox ItemsSource="{Binding YourItems}">
      <ListBox.ItemTemplate>
           <DataTemplate>
                 <TextBlock Text="{Binding TextProperty}" TextWrapping="Wrap"/>
           </DataTemplate>
      </ListBox.ItemTemplate>
 </ListBox>

This assumes your viewmodel has a "YourItems" property that is an IEnumerable and that YourObject has a TextProperty property on it that is a string

You can do this by modifying the ItemsTemplate

 <ListBox ItemsSource="{Binding YourItems}">
      <ListBox.ItemTemplate>
           <DataTemplate>
                 <TextBlock Text="{Binding TextProperty} TextWrapping="Wrap"/>
           </DataTemplate>
      </ListBox.ItemTemplate>
 </ListBox>

This assumes your viewmodel has a "YourItems" property that is an IEnumerable and that YourObject has a TextProperty property on it that is a string

You can do this by modifying the ItemsTemplate

 <ListBox ItemsSource="{Binding YourItems}">
      <ListBox.ItemTemplate>
           <DataTemplate>
                 <TextBlock Text="{Binding TextProperty}" TextWrapping="Wrap"/>
           </DataTemplate>
      </ListBox.ItemTemplate>
 </ListBox>

This assumes your viewmodel has a "YourItems" property that is an IEnumerable and that YourObject has a TextProperty property on it that is a string

Source Link
Shawn Kendrot
  • 12.5k
  • 1
  • 28
  • 41

You can do this by modifying the ItemsTemplate

 <ListBox ItemsSource="{Binding YourItems}">
      <ListBox.ItemTemplate>
           <DataTemplate>
                 <TextBlock Text="{Binding TextProperty} TextWrapping="Wrap"/>
           </DataTemplate>
      </ListBox.ItemTemplate>
 </ListBox>

This assumes your viewmodel has a "YourItems" property that is an IEnumerable and that YourObject has a TextProperty property on it that is a string