i need help with UniformGrid, or Grid, table, whatever.
Simple Version: I have a MainWindow with only 6 Rectangle, and they should fill my entire MainWindow. When i resize the window, those 6 Rectangle need to able to resize and keep the same width and height like all the other rectangles.
I eventually need to replace my rectangles with actual content, such as 6 videos playing, or 6 web browsers, or 6 images, etc, all with same width/height, as the window resizes by the user.
Here are the rectangles.
Here is my XAML code so far. It doesn't quite work, as even if i resize the MainWindow, the rectangles all stay as "squares", they always have length = width. But i need rectangles, with sometimes the length could be greater than width, since he window is resized by user however he wants.
<UniformGrid Rows="2" Columns="3">
<Rectangle Stretch="UniformToFill" Fill="Black" />
<Rectangle Stretch="UniformToFill" Fill="Blue" />
<Rectangle Stretch="UniformToFill" Fill="Red" />
<Rectangle Stretch="UniformToFill" Fill="Green" />
<Rectangle Stretch="UniformToFill" Fill="Yellow" />
<Rectangle Stretch="UniformToFill" Fill="Orange" />
</UniformGrid>
Complex Version: I eventually need to allow user to display 1, 2, 4, or 6 displays, so they need to take up the entire window with width/height.
Here's how it would look if it should display 2 display. (when the user resize the window so that length > width)