Use the docpanel to evenly distribute all children

What I would like to do is create a dock with 4 buttons and have the same button sizes.

However, when I do this now, it formats the first 3 buttons to fill the contents of the button, and the last button fills the remaining space.

Is there a way to have a control in which I can put 4 buttons and make them equal in size. I already saw problems with the StackPanel, and while reading, I thought that the docpanel would fix this for me.

I know I can use setup grid to fix this, but I was trying to find another solution.

+4
source share
1 answer

I don’t know which grid you know how to use, but I found that the simplest solution is to use a UniformGrid with 1 row. This should fill all buttons the same way.

+4
source

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


All Articles