将可调整大小的 Expander 从右向左展开
我想要下面问题中的扩展器(请参阅已接受的答案),这对我来说是一个完美的解决方案。我只想把它放在右边。
使其从右向左扩展我更改了类似行为的设置。 (我强调了一些元素,以便更好地了解正在发生的情况):
<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>
当我将分离器向右移动时,它会调整分离器左侧区域的大小。我尝试了许多其他组合,但几乎导致了相同的不良行为。分割器左侧的区域有时会奇怪地爆炸,但 TextBox 保持不变。
I would like to have the Expander from question below (see the accepted answer) which is a perfect solution for me. I just want to have it on the right side.
Combine expander and grid (resizable expander)
To have it expanded from right to left I changed the settings for an analoguous behavior. (I emphasized elements to see better what's going on):
<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 from the splitter when I move the splitter to the right. I tried many other combinations but it almost resulted in the same unwanted behavior. The area left of the splitter is sometimes kind of weirdly exploding but TextBox remains unchanged.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
尝试这样:
Try like this: