I have to design something like that:

enter image description here

Should I use a Grid (2 rows, 2 columns), or should I use a horizontal StackPanel with button 1 and another vertical StackPanel with buttons 2 and 3.

And especially - WHY should I use each option.

有帮助吗?

解决方案

You should consider your layout panel based on the following contexts:

Moving, Alignment, Resizing, and Docking.

If you use a WrapPanel for example, you will notice that when resizing the window, the button's will maintain their original size and stack on top of each other to fit to the window size, while in a Grid they will change their size to maintain their current location.

I suggest you to test your options by the mentioned ciritia's and choose what best fits your requierments.

其他提示

if your Items in Grid has same size, you can use

<UniformGrid></UniformGrid>
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top