Conversation
5b79950 to
44f78fa
Compare
|
Adding the |
There was a problem hiding this comment.
Hey Vlad!
Let's Update 2 Things:
- Move
UniformGridfrom theViewsfolder/namespace toLayoutsfolder + namespace- Technically,
UniformGridis aView, but since it containsList<IView> Children, it is more accurate to define it as aLayout
- Technically,
- Rearchitect
UniformGrid- Let's have
UniformGridinherit fromLayoutinsteadGrid, e.g.public class UniformGrid : Layout - (More thoughts below)
- Let's have
Rearchitecting UniformGrid
I think we need to rethink how UniformGrid is architected.
A lot of Grid properties are not being used (like RowDefinitions and ColumnDefinitions) because ILayoutManager is essentially re-drawing the UI on the screen to imitate a Grid.
Perhaps we don't inherit from Grid, and instead Layout instead.
👇 Check out this example I added to the sample where I add an IView to the UniformGrid using uniformGrid.Children.Add().
The child is added to the Grid, but it is always added to the same column + row.
Once the row becomes wider than the screen, it wraps around creating what looks like a new column.
And if I specify a Row/Column for the child, it is ignored; the child is always added to the same row/column:
var boxView = new BoxView
{
HeightRequest = widthRequest,
WidthRequest = heightRequest,
Color = randomColor
};
Grid.SetRow(boxView, 1);
Grid.SetColumn(boxView, 1);
uniformGrid.Children.Add(boxView);ScreenFlow.mp4
|
Hey Brandon, maybe rename the control to UniformLayout? |
|
Yea! Naming is tough, but I like where you're going with it! Along with Here's a couple more ideas:
I'm not sold on any of these, but sometimes it helps to throw a bunch of names out there 😃 |
You are telling me! Child 1 and Child 2 would definitely agree with you 😆
I still quite like
|
83be63e to
101d826
Compare
* 122 UniformGrid * Fix for rc2. remove compatibility usage * Add comments, add tests * Fix uniform tests * MaxRows, MaxColumns * Add samples Co-authored-by: Brandon Minnick <13558917+brminnick@users.noreply.github.com> Co-authored-by: Pedro Jesus <pedrojesus.cefet@gmail.com> Update Syntax Update Formatting Update Descriptions UniformGridTestPage Update UniformGridTestPage.xaml.cs
101d826 to
734c1aa
Compare
64fa672 to
4ec2c62
Compare
TheCodeTraveler
left a comment
There was a problem hiding this comment.
Thanks Vlad! I love the new name, love the new IUniformItemsLayout interface, and am impressed at the elegance of the implementation of UniformItemsLayout 💯 👏
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
TheCodeTraveler
left a comment
There was a problem hiding this comment.
Approving again now that we've updated the CI Pipeline for .NET MAUI Preview 13
* 122 UniformGrid (CommunityToolkit#139) * 122 UniformGrid * Fix for rc2. remove compatibility usage * Add comments, add tests * Fix uniform tests * MaxRows, MaxColumns * Add samples Co-authored-by: Brandon Minnick <13558917+brminnick@users.noreply.github.com> Co-authored-by: Pedro Jesus <pedrojesus.cefet@gmail.com> Update Syntax Update Formatting Update Descriptions UniformGridTestPage Update UniformGridTestPage.xaml.cs * Make it more MAUI style * Remove NSubstitute * Rename folder from `Views` to `Layouts` * Create `UniformItemsLayoutViewModel.cs` and `UniformItemsLayoutTestViewModel` * Update Formatting * Remove whitespace * Update UniformItemsLayoutTestPage.xaml * Update `UniformItemsLayoutTestPage` * Remove test page Co-authored-by: Brandon Minnick <13558917+brminnick@users.noreply.github.com>
Fixes
#122
Description
Migrate UniformGrid to MCT
