I am binding a collection (rss feed) into a list box such as this:
<ListBox Margin="0,0,-12,0" ItemsSource="{Binding Items}">
<ListBox.ItemTemplate>
<DataTemplate>
<StackPanel Margin="0,0,0,17" Width="432">
<HyperlinkButton Content={Binding Title} NavigateUri="{Binding Link}" />
<TextBlock Text="{Binding Description}" />
</StackPanel>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
This works great - the data displays correctly etc. But now when I changed it to use text wrapping, the title is not displaying anymore.
Here is the problematic code.
<ListBox Margin="0,0,-12,0" ItemsSource="{Binding Items}">
<ListBox.ItemTemplate>
<DataTemplate>
<StackPanel Margin="0,0,0,17" Width="432">
<HyperlinkButton NavigateUri="{Binding Link}">
<TextBlock Text="{Binding Title}" TextWrapping="Wrap" />
</HyperlinkButton>
<TextBlock Text="{Binding Description}" TextWrapping="Wrap" />
</StackPanel>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
I don't think it's the "TextWrapping" attribute that is causing the issue, since I tried without it and it still did not work. So my question is how do you get something like this to work? I just want to display a hyperlink with wrapped bound text. It looks like a fairly simple thing to do - but yet so hard. Help?