CommunityToolkit/WindowsCommunityToolkit

AdaptiveGridView throws argument exception

Open

#3.142 geöffnet am 21. Feb. 2020

Auf GitHub ansehen
 (11 Kommentare) (3 Reaktionen) (0 zugewiesene Personen)C# (1.403 Forks)batch import
bug :bug:controls :control_knobs:help wantedneed more info :pushpin:

Repository-Metriken

Stars
 (5.708 Stars)
PR-Merge-Metriken
 (Keine gemergten PRs in 30 T)

Beschreibung

Upon resizing the control the adaptive grid view throws argument exception.

This happens when toggling the visibility of a control using the adaptive grid view. On some cases theCalculateItemWidth method returns an invalid Item width.

[Update] var columns = CalculateColumns(containerWidth, DesiredWidth); CalculateColumns method returns an invalid value (negative value) when DesiredWidth value is 0, But still can't get enough clue why the desired width is set to 0.

StackTrace is as below System.ArgumentException: Value does not fall within the expected range. at Windows.UI.Xaml.DependencyObject.SetValue(DependencyProperty dp, Object value) at Microsoft.Toolkit.Uwp.UI.Controls.AdaptiveGridView.RecalculateLayout(Double containerWidth) at Microsoft.Toolkit.Uwp.UI.Controls.AdaptiveGridView.OnSizeChanged(Object sender, SizeChangedEventArgs e)

Contributor Guide