I bind the collection (rss channel) to the list box, for example:
<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 - data is displayed correctly, etc. But now that I have changed it to use text wrapping, the title no longer displays.
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 this is the “TextWrapping” attribute, which is causing the problem since I tried without it and it still didn't work. So my question is: how do you work on this? I just want to display a hyperlink with wrapped related text. It seems like a pretty simple thing - but still so complicated. Help?
Johannes Setiabudi
source share