I have three columns containing two expanders in left and right columns. When both the expnders collapsed, I need to arrage the content in the middle column on the full window. For that I need to calculate the gridlengths.
For Example
GridLength w1= new GridLength( 20 );
GridLength w2= new GridLength( 50 );
GridLength w3= new GridLength( 0 );
How to get
w3 = w2 - w1
Try this: Set the widths of the expandable
ColumnDefinitions
toAuto
and the middle one to 1 star-unit. Control the width of the Expandable columns by setting the width on their contents. Then when they collapse, the middle column should expand to fill the available space.Example:
Hope this helps