.net - WPF Column set MIN height by dynamic margins? -
is possible set minimum height of row dynamic based on content? brief explanation:
i have piece of ui:
the whole thing divided grid 2 rows, 1 * height top message , other "auto" height bottom option buttons are. works great full ui keeps buttons stacked @ bottom want them , text in top blank section centered should be.
however, when make small enough not fits, starts cover on message text , leaves bottom buttons. can sent min height on top row , when top row gets minimum size starts cutting off recent files livable small, , removing older recent files not big deal.
so main issue message can change based on results of other code , several lines or 1 line. can hard code min height, if make large enough fit longer messages there large margin around 1 liners , if fit 1 liners cuts off longer ones. since text wraps, height of text message depends on width of window variable well. is possible tell wpf minimum height of row content height plus margin?
if it's not possible can live hard coded height don't spend lot of time, thought worth asking :)
i have top row height=auto
, second row height=*
remembering add textwrapping=wrap
, add margin first item/panel in second row
eg simple example
<grid width="200"> <grid.rowdefinitions> <rowdefinition height="auto"/> <rowdefinition height="*"/> </grid.rowdefinitions> <textblock text="some text in top" textwrapping="wrap"></textblock> <listbox grid.row="1" margin="0,20"/> </grid>
you need scrollviewer
wrapped around grid
cope different size windows
Comments
Post a Comment