xaml - Grid column definitions -
inside same stackpanel i'd put control aligned on left , 1 on right side. made attempt using grid , defining columndefinitions no luck.
<stackpanel orientation="horizontal"> <grid> <grid.columndefinitions> <columndefinition width="auto" /> <columndefinition width="72" /> </grid.columndefinitions> <stackpanel horizontalalignment="left" grid.column="0" orientation="horizontal"> <button /> </stackpanel> <stackpanel horizontalalignment="right" grid.column="1"> <button height="72" width="72" /> </stackpanel> </grid> </stackpanel> the first column take 50% 80% of total width (depending on content), while second column take 72px. how can set first column fills total grid width minus 72px?
set width property of first column star:
<columndefinition width="*" /> making change in code should work:
<stackpanel> <grid> <grid.columndefinitions> <columndefinition width="*" /> <columndefinition width="72" /> </grid.columndefinitions> <stackpanel grid.column="0" orientation="horizontal"> <button /> </stackpanel> <stackpanel horizontalalignment="right" grid.column="1"> <button height="72" width="72" /> </stackpanel> </grid> </stackpanel>
Comments
Post a Comment