icon select

This commit is contained in:
2022-03-02 10:45:40 +08:00
parent 2179c6a981
commit aa38e186c7
24 changed files with 288 additions and 35 deletions

View File

@ -8,8 +8,8 @@ namespace Billing.UI
public class WrapLayout : Layout<View>
{
public static readonly BindableProperty ItemsSourceProperty = BindableProperty.Create(nameof(ItemsSource), typeof(IList), typeof(WrapLayout), propertyChanged: OnItemsSourcePropertyChanged);
public static readonly BindableProperty ColumnSpacingProperty = BindableProperty.Create(nameof(ColumnSpacing), typeof(double), typeof(WrapLayout), defaultValue: 5.0, propertyChanged: (obj, _, _) => ((WrapLayout)obj).InvalidateLayout());
public static readonly BindableProperty RowSpacingProperty = BindableProperty.Create(nameof(RowSpacing), typeof(double), typeof(WrapLayout), defaultValue: 5.0, propertyChanged: (obj, _, _) => ((WrapLayout)obj).InvalidateLayout());
public static readonly BindableProperty ColumnSpacingProperty = BindableProperty.Create(nameof(ColumnSpacing), typeof(double), typeof(WrapLayout), defaultValue: 4d, propertyChanged: (obj, _, _) => ((WrapLayout)obj).InvalidateLayout());
public static readonly BindableProperty RowSpacingProperty = BindableProperty.Create(nameof(RowSpacing), typeof(double), typeof(WrapLayout), defaultValue: 4d, propertyChanged: (obj, _, _) => ((WrapLayout)obj).InvalidateLayout());
private static void OnItemsSourcePropertyChanged(BindableObject obj, object old, object @new)
{
@ -177,14 +177,14 @@ namespace Billing.UI
{
cellSize.Width = (width - columnSpacing * (columns - 1)) / columns;
}
if (double.IsPositiveInfinity(height))
//if (double.IsPositiveInfinity(height))
{
cellSize.Height = maxChildSize.Height;
}
else
{
cellSize.Height = (height - RowSpacing * (rows - 1)) / rows;
}
//else
//{
// cellSize.Height = (height - RowSpacing * (rows - 1)) / rows;
//}
layoutData = new LayoutData(visibleChildrenCount, cellSize, rows, columns);
}
else