code_junkie

Force textblock to wrap in WPF listbox

Nov 13th, 2011
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.90 KB | None | 0 0
  1. <ListBox HorizontalContentAlignment="Stretch" ItemsSource="{Binding Path=FriendsTimeline}">
  2. <ListBox.ItemTemplate>
  3. <DataTemplate>
  4. <StackPanel Orientation="Horizontal">
  5. <Border BorderBrush="DarkBlue" BorderThickness="3" CornerRadius="2" Margin="3" >
  6. <Image Height="32" Width="32" Source="{Binding Path=User.ProfileImageUrl}"/>
  7. </Border>
  8. <StackPanel Orientation="Vertical">
  9. <TextBlock Text="{Binding Path=User.UserName}"/>
  10. <TextBlock Text="{Binding Path=Text}" TextWrapping="WrapWithOverflow"/> <!-- This is the textblock I'm having issues with. -->
  11. </StackPanel>
  12. </StackPanel>
  13. </DataTemplate>
  14. </ListBox.ItemTemplate>
  15. </ListBox>
Add Comment
Please, Sign In to add comment