Windowscommunitytoolkit: UniformGrid does not behaves well with dynamic changes

Created on 24 May 2018  路  8Comments  路  Source: windows-toolkit/WindowsCommunityToolkit

I'm submitting a...

  • Bug report (I searched for similar issues and did not find one)



Current behavior

I've copied the sample code inside the docs (https://docs.microsoft.com/en-us/windows/uwpcommunitytoolkit/controls/uniformgrid) and executed the app. It works as expected, but if I change the values dynamically (the elements Grid.Column and the UniformGrid's Rows properties, for example) they don't give the same result as if I close the app and run it again with the new value.

Expected behavior

The control should reevaluate it's children position correctly if I change it's values.

Minimal reproduction of the problem with instructions

1) Create a simple UniformGrid.

<controls:UniformGrid Margin="10" Rows="1"
        HorizontalAlignment="Right"
        VerticalAlignment="Bottom">
      <Button Grid.Column="0" Content="No" FontSize="18" Margin="5" Padding="6,3" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"/>
      <Button Grid.Column="1" Content="Yes, Absolutely" Margin="5" Padding="6,3" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"/>
      <Button Grid.Column="2" Content="Maybe" Margin="5" Padding="6,3" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"/>
</controls:UniformGrid>

2) Debug the project.
3) With the debugger attached, delete all the XAML's Grid.Column="X".
Expected result:
image
Actual result:
image

If you restart the project with the new source, the UniformGrid renders as expected.

Environment

Nuget Package(s): Microsoft.Toolkit.Uwp.UI.Controls

Package Version(s): 3.0.0-build.328

Windows 10 Build Number:
- [ ] Creators Update (15063)
- [ ] Fall Creators Update (16299)
- [ ] April 2018 Update (17134)
- [X] Insider Build (build number: )

App min and target version:
- [Min] Creators Update (15063)
- [ ] Fall Creators Update (16299)
- [Target] April 2018 Update (17134)
- [ ] Insider Build (xxxxx)

Device form factor:
- [X] Desktop
- [ ] Mobile
- [ ] Xbox
- [ ] Surface Hub
- [ ] IoT

Visual Studio 
- [X] 2017 (version: 15.7.2)
- [ ] 2017 Preview (version: )
bugbash feature request no-recent-activity

Most helpful comment

@nmetulev should we change this to 'feature-request' and open a user-voice or something for this since it was outside of the initial scope?

All 8 comments

This was out of scope for V1, I call it out in the docs:

Important
Fixed locations must be provided before initial layout. Otherwise, an element will be marked to always participate in automatic layout.

@nmetulev should we change this to 'feature-request' and open a user-voice or something for this since it was outside of the initial scope?

sounds good, can you create the user voice?

Seems like there is no uservoice entry created.

Seems like there is no uservoice entry created.

Seems like there is no uservoice entry created.

Seems like there is no uservoice entry created.

This issue seems inactive. It will automatically be closed in 14 days if there is no activity.

Was this page helpful?
0 / 5 - 0 ratings