expression blend - Silverlight: Set MaxWidth of a textblock to containing column width -
in silverlight 4 app, have simple 3-columns grid, contains 3 textblocks.
<grid background="{staticresource brushcharacteristiclistboxitembackground}"> <grid.columndefinitions> <columndefinition width="0.5*"/> <columndefinition width="10"/> <columndefinition width="0.5*"/> </grid.columndefinitions> <textblock x:name="textblockcharacteristicname" text="{binding property1}" horizontalalignment="left" texttrimming="wordellipsis" tooltipservice.tooltip="{binding text}" margin="6,0,0,0" /> <textblock x:name="textblockseperator" text="=" grid.column="1" /> <textblock x:name="textblockcharacteristicvalue" text="{binding property3}" grid.column="2" horizontalalignment="right" margin="0,0,6,0" /> </grid>
the width of grid depends on containing user control. want cap size of first , third textblock current size of containing column, using maxsize , bind somehow size of column of grid.
can here tell me how this?
thanks in advance,
frank
by default horizontalalignment
property of textblock
set "stretch" fill available size of column in, regardless of content. want?
perhaps reason not want textblock
wide column in if content not need available space?
if set textblock.horizontalalignment
"left". textblock
wide needs until reaches width of column, width constrained column.
Comments
Post a Comment