Pregunta

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.

¿Fue útil?

Solución

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.

Otros consejos

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

<UniformGrid></UniformGrid>
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top