locked
Want to show Content of Button as Wrapped RRS feed

  • Question

  • Hi

    I am displaying list of Buttons in my app and I have bind the content of Button in code behind but I want to show the content as Wrapped or if space is full it should show three dots next to the content text.

    Please Help

    Thanks in advance

    Regards

    Rishi

    Wednesday, November 28, 2012 2:07 PM

Answers

  • Make your buttons look like this:

    <Button>
        <TextBlock x:Name="textBlock" TextWrapping="Wrap" TextTrimming="WordEllipsis" />
    </Button>

    Then bind to the Text of the textBlock in codebehind, instead of to the Content of the button.
    • Marked as answer by RishiRajIT Wednesday, November 28, 2012 3:22 PM
    Wednesday, November 28, 2012 2:33 PM

All replies

  • Make your buttons look like this:

    <Button>
        <TextBlock x:Name="textBlock" TextWrapping="Wrap" TextTrimming="WordEllipsis" />
    </Button>

    Then bind to the Text of the textBlock in codebehind, instead of to the Content of the button.
    • Marked as answer by RishiRajIT Wednesday, November 28, 2012 3:22 PM
    Wednesday, November 28, 2012 2:33 PM
  • Thanks  Diederik
    Wednesday, November 28, 2012 3:23 PM