Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5936717
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T15:26:17+00:00 2026-05-22T15:26:17+00:00

I am binding a collection (rss feed) into a list box such as this:

  • 0

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?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T15:26:17+00:00Added an answer on May 22, 2026 at 3:26 pm

    I was having the exact same problem and I couldn’t understand why it wasn’t working until I ran across this blog post by Mister Goodcat. In his post he said that because of some optimizations made for the WP7 in Silverlight the basic functionality that works in normal Silverlight does not work correctly for WP7 Silverlight. Instead of using he suggests modifying the Style instead.

    The easiest way to edit the default templates still is to use Expression Blend to make a copy of it and work from there. When you do that you’ll see that the template really only has a text block to show the content. That is why using another UI element as content doesn’t work for the hyperlink button on WP7. If you only want to make the text wrap, it’s sufficient to change the TextWrapping property on that text block.

    <Style x:Key="HyperlinkButtonWrappingStyle"
            TargetType="HyperlinkButton">
        <Setter Property="Foreground"
                Value="{StaticResource PhoneForegroundBrush}" />
        <Setter Property="Background"
                Value="Transparent" />
        <Setter Property="FontSize"
                Value="{StaticResource PhoneFontSizeMedium}" />
        <Setter Property="Padding"
                Value="0" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="HyperlinkButton">
                    <Border Background="Transparent">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal" />
                                <VisualState x:Name="MouseOver" />
                                <VisualState x:Name="Pressed">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0"
                                                            To="0.5"
                                                            Storyboard.TargetProperty="Opacity"
                                                            Storyboard.TargetName="TextElement" />
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Foreground"
                                                                        Storyboard.TargetName="TextElement">
                                            <DiscreteObjectKeyFrame KeyTime="0"
                                                                    Value="{StaticResource PhoneDisabledBrush}" />
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Border Background="{TemplateBinding Background}"
                                Margin="{StaticResource PhoneHorizontalMargin}"
                                Padding="{TemplateBinding Padding}">
                            <TextBlock x:Name="TextElement"
                                        HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                        Text="{TemplateBinding Content}"
                                        TextDecorations="Underline"
                                        VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                                        TextWrapping="Wrap" />
                        </Border>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    

    I suggest reading his blog post for more information & help.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I´m binding a pretty huge collection of items to an ItemsControl. The ItemTemplate of
I'm receiving this error: items collection must be empty before using itemssource in a
Binding a List collection to a datagrid. How can you limit what properties will
I'm binding a GridView to a collection of objects that look like this: public
I'm binding a collection of objects to a listbox in WPF, for simplicity we'll
What would be the best collection to use when binding a list of data
I'm trying to bind to a collection of controls I generate dynamically: <ItemsControl ItemsSource={Binding
I am data binding a IQueryable collection of Suppliers to a listbox as follows
i have a combobox : <Grid> <ComboBox Height=52 HorizontalAlignment=Left ItemsSource={Binding templatesNames} SelectedValuePath=Type.FullName Margin=169,43,0,0 Name=comboBox1
I have a listbox that I'm binding to a collection of objects. In the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.