Place resizable expander to expand from right to left

I would like to see Expander from the question below (see accepted answer), which is the perfect solution for me. I just want to have it on the right side.

Combine the expander and the grid (variable expander size)

To expand it from right to left, I changed the settings for a similar behavior. (I emphasized the elements to better understand what is happening):

<Expander Grid.Column="1" Header="Test" ExpandDirection="Left" BorderThickness="10" BorderBrush="Black" HorizontalAlignment="Right" > <Expander.Content> <Grid > <Grid.ColumnDefinitions> <ColumnDefinition Width="Auto"/> <ColumnDefinition Width="Auto" /> </Grid.ColumnDefinitions> <GridSplitter Grid.Column="0" Width="10" Background="Green" ResizeDirection="Columns" ResizeBehavior="CurrentAndNext" /> <TextBox Grid.Column="1" Text="Lorem ipsum dolor sit" BorderThickness="10" BorderBrush="Red"/> </Grid> </Expander.Content> </Expander> 

It resizes the area left of the splitter when I move the splitter to the right. I tried many other combinations, but it almost led to the same undesirable behavior. The area to the left of the splitter sometimes looks strangely explosive, but the TextBox remains unchanged.

+4
source share
1 answer

Try it like this:

 <Expander Grid.Column="1" Header="Test" ExpandDirection="Left" BorderThickness="10" BorderBrush="Black" HorizontalAlignment="Right"> <Expander.Content> <Grid> <Grid.ColumnDefinitions> <ColumnDefinition Width="*" MinWidth="10" /> <ColumnDefinition Width="Auto" /> </Grid.ColumnDefinitions> <GridSplitter Grid.Column="0" Width="10" Background="Green" ResizeDirection="Columns" ResizeBehavior="CurrentAndNext" /> <TextBox Grid.Column="1" Text="Lorem ipsum dolor sit" BorderThickness="10" BorderBrush="Red"/> </Grid> </Expander.Content> </Expander> 
+7
source

Source: https://habr.com/ru/post/1390793/


All Articles