Word Wrap ContentPresenter targettype Textblock RRS feed

  • Question

  • I'm looking for a more efficient way to apply text wrapping to content presenters in templates that load it as a textblock on runtime that's more efficient than how I currently am. I have a nice trick for WPF but it doesn't appear to work in silverlight with making a style in a res. dict. and calling it to the contentpresenter in a template.

    Basically, does anyone know a nice efficient way of textwrapping a textblock contentpresenter in a template? Thanks!

    Mark answered questions to help others.
    Tuesday, December 27, 2011 9:01 PM


  • So I decided to delete the contentpresenter where necessary and bind a textblock to the content as a template binding like I would normally. eg;

    <TextBlock Text="{TemplateBinding Content}" TextWrapping="Wrap"></TextBlock>

    I was trying to keep the contentpresenter objects as requested by the dev's but I haven't found a way other than the standard route to accomplish it contentpresenter, oh well. If anyone happens to think of a way I'm still interested to know.

    Mark answered questions to help others.
    Wednesday, December 28, 2011 3:44 PM