Is it possible in XAML to automatically separate elements in a StackPanel no matter what the size of the window is?
In CSS with the property : space between you can send elements to both sides of the parent. This is what I want to reproduce. Is it possible ?

A
StackPaneldoes not work this way , see the documentation. It does not have a notion of the available space or remaining space to divide, it just stacks elements in one direction.What you can do instead is use a
DockPanel. It allows stacking controls to either side of the panel and by default the last element added to it fills the remaining space. TheBorderhere serves as a dummy element to take the remaining space. Usually, you would put a control there that is actually used. Please be aware that this example only reproduces what you explicitly asked for, the panel allows for much more complex layouts. See remarks from the documentation.An alternative is to use a
Gridwith three columns, where the left and right columns useAutoasWidthso the contained controls only take up as much space as they need, while the center column has itsWidthset to*, which will make it fit the remaining space.The relevant portion on size attributes for
Grid:Update for your list example. You can define a data template for the items.
If you want two fixed columns in the
ListView, use aUniformGridinstead of aWrapPaneland remove the fixed sizes. With anItemContainerStylethe items will then scale with the window.