c# - Collapsed Grid in StackPanel change position of other controls in StackPanel -
i have xaml
page:
<stackpanel orientation="horizontal"> <grid x:name="inkgrid0" margin="0,0,0,0" horizontalalignment="left" > <canvas x:name="inkcanvas0" width="570"> <canvas.background> <imagebrush x:name="dimage0" imagesource="{binding}"/> </canvas.background> </canvas> </grid> <grid x:name="inkgrid1" margin="0,0,0,0" horizontalalignment="right" > <canvas x:name="inkcanvas1" width="570"> <canvas.background> <imagebrush x:name="dimage1" imagesource="{binding}"/> </canvas.background> </canvas> </grid> </stackpanel>
once add inkgrid0.visibility = visibility.collapsed
code, inkgrid1
take left position of inkgrid0
collapsed.
how make inkgrid1
@ place when inkgrid0
collapsed?
simply set it's opacity 0 if don't want deal resizing etc.however must consider interactions tapping or clicking.
setting opacity instead of visibility usefull in terms of performance , it's easy.
Comments
Post a Comment