I'm trying to create a side collapsible panel that include StackPanel
For that Tried use Expander
like following
<Expander Width="auto" ExpandDirection="Left" HorizontalAlignment="Right">
<Expander.Header>
<Border BorderBrush="Black" BorderThickness="1">
<StackPanel>
<Grid>
</Grid>
</StackPanel>
</Border>
</Expander.Header>
</Expander>
But this is not working properly, can't do the function that I expected.
As Maciek Świszczowski said, you need to properly align your expander and put the contents inside the context section of the expander. Also, assuming you want it to fill the entire left section, I would recommend you use a Grid
to hold it all, like so:
Example:
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<Expander ExpandDirection="Right" HorizontalAlignment="Left">
<Border BorderBrush="Black" BorderThickness="1">
</Border>
</Expander>
</Grid>
Here's what it looks like (I put a blue background and some text in the expander, and just a red stack panel in the second column in order to make it really clear).
Expanded:
Collapsed:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With