Grid usage issues #17994
-
I want to make the lower area visible or hidden by clicking on the ToggleSwitch, and adjust the height of the upper and lower areas by dragging the GridSplitter. It's normal to click the ToggleSwitch like this, but the lower area is not normal when I drag the GridSplitter. RowDefinitions="*,4,Auto" Border ... Height="220"
It's normal to drag the GridSplitter like this, but clicking the ToggleSwitch will leave the lower area blank. RowDefinitions="*,4,220"
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
The lower area will be empty. You need to manually reset the definitions to auto otherwise. eg. public MainWindow()
{
InitializeComponent();
showBottomArea.IsCheckedChanged += ShowBottomArea_IsCheckedChanged;
}
private void ShowBottomArea_IsCheckedChanged(object? sender, Avalonia.Interactivity.RoutedEventArgs e)
{
if (showBottomArea.IsChecked is false)
{
grid.RowDefinitions = RowDefinitions.Parse("*, auto, auto");
}
} I'm not sure if your layout is the same as mine, but you'll have resizing issues with the grid splitter's resizing area overlapping the window frame's resizing area. |
Beta Was this translation helpful? Give feedback.
The lower area will be empty.
GridSplitter
directly modifies the theRowDefinitions
/ColumnDefinitions
collection. Your third row containing theBorder
will have its auto-sizing set to an explicit height value and that's how the resizing is implemented.You need to manually reset the definitions to auto otherwise. eg.
I'm not sure if your…