Skip to content

Commit

Permalink
remove all caching
Browse files Browse the repository at this point in the history
  • Loading branch information
Edward Miller committed Sep 14, 2024
1 parent 68d3149 commit 67278bf
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 359 deletions.
217 changes: 0 additions & 217 deletions Maui.DataGrid/Collections/ConcurrentLRUCache.cs

This file was deleted.

44 changes: 1 addition & 43 deletions Maui.DataGrid/CompatibilitySuppressions.xml
Original file line number Diff line number Diff line change
@@ -1,46 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- https://learn.microsoft.com/en-us/dotnet/fundamentals/package-validation/diagnostic-ids -->
<Suppressions xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<Suppression>
<DiagnosticId>CP0002</DiagnosticId>
<Target>F:Maui.DataGrid.DataGrid.CacheSizeProperty</Target>
<Left>lib/net8.0/Maui.DataGrid.dll</Left>
<Right>lib/net8.0/Maui.DataGrid.dll</Right>
<IsBaselineSuppression>true</IsBaselineSuppression>
</Suppression>
<Suppression>
<DiagnosticId>CP0002</DiagnosticId>
<Target>F:Maui.DataGrid.DataGrid.CachingEnabledProperty</Target>
<Left>lib/net8.0/Maui.DataGrid.dll</Left>
<Right>lib/net8.0/Maui.DataGrid.dll</Right>
<IsBaselineSuppression>true</IsBaselineSuppression>
</Suppression>
<Suppression>
<DiagnosticId>CP0002</DiagnosticId>
<Target>M:Maui.DataGrid.DataGrid.get_CacheSize</Target>
<Left>lib/net8.0/Maui.DataGrid.dll</Left>
<Right>lib/net8.0/Maui.DataGrid.dll</Right>
<IsBaselineSuppression>true</IsBaselineSuppression>
</Suppression>
<Suppression>
<DiagnosticId>CP0002</DiagnosticId>
<Target>M:Maui.DataGrid.DataGrid.get_CachingEnabled</Target>
<Left>lib/net8.0/Maui.DataGrid.dll</Left>
<Right>lib/net8.0/Maui.DataGrid.dll</Right>
<IsBaselineSuppression>true</IsBaselineSuppression>
</Suppression>
<Suppression>
<DiagnosticId>CP0002</DiagnosticId>
<Target>M:Maui.DataGrid.DataGrid.set_CacheSize(System.Int32)</Target>
<Left>lib/net8.0/Maui.DataGrid.dll</Left>
<Right>lib/net8.0/Maui.DataGrid.dll</Right>
<IsBaselineSuppression>true</IsBaselineSuppression>
</Suppression>
<Suppression>
<DiagnosticId>CP0002</DiagnosticId>
<Target>M:Maui.DataGrid.DataGrid.set_CachingEnabled(System.Boolean)</Target>
<Left>lib/net8.0/Maui.DataGrid.dll</Left>
<Right>lib/net8.0/Maui.DataGrid.dll</Right>
<IsBaselineSuppression>true</IsBaselineSuppression>
</Suppression>
</Suppressions>
</Suppressions>
36 changes: 2 additions & 34 deletions Maui.DataGrid/DataGrid.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -115,18 +115,6 @@ public partial class DataGrid
}
});

/// <summary>
/// Gets or sets a value indicating whether the DataGrid allows caching.
/// </summary>
public static readonly BindableProperty CachingEnabledProperty =
BindablePropertyExtensions.Create<DataGrid, bool>(false);

/// <summary>
/// Gets or sets a value indicating whether the DataGrid allows caching.
/// </summary>
public static readonly BindableProperty CacheSizeProperty =
BindablePropertyExtensions.Create<DataGrid, int>(DefaultCacheSize);

/// <summary>
/// Gets or sets the Columns for the DataGrid.
/// </summary>
Expand Down Expand Up @@ -810,26 +798,6 @@ public IEnumerable ItemsSource
set => SetValue(ItemsSourceProperty, value);
}

/// <summary>
/// Gets or sets a value indicating whether caching is enabled in the DataGrid.
/// Default value is False.
/// </summary>
public bool CachingEnabled
{
get => (bool)GetValue(CachingEnabledProperty);
set => SetValue(CachingEnabledProperty, value);
}

/// <summary>
/// Gets or sets a value indicating the size of the cache for the DataGrid.
/// Default value is 100000.
/// </summary>
public int CacheSize
{
get => (int)GetValue(CacheSizeProperty);
set => SetValue(CacheSizeProperty, value);
}

/// <summary>
/// Gets or sets columns of the DataGrid.
/// </summary>
Expand Down Expand Up @@ -1384,11 +1352,11 @@ private IEnumerable<object> GetSortedItems(IList<object> unsortedItems, SortData
{
case SortingOrder.Ascendant:
_ = columnToSort.SortingIcon.RotateTo(0);
items = unsortedItems.OrderBy(x => x.GetValueByPath(columnToSort.PropertyName, CachingEnabled, CacheSize));
items = unsortedItems.OrderBy(x => x.GetValueByPath(columnToSort.PropertyName));
break;
case SortingOrder.Descendant:
_ = columnToSort.SortingIcon.RotateTo(180);
items = unsortedItems.OrderByDescending(x => x.GetValueByPath(columnToSort.PropertyName, CachingEnabled, CacheSize));
items = unsortedItems.OrderByDescending(x => x.GetValueByPath(columnToSort.PropertyName));
break;
case SortingOrder.None:
return unsortedItems;
Expand Down
2 changes: 1 addition & 1 deletion Maui.DataGrid/DataGridColumn.cs
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,7 @@ internal void InitializeDataType()
}
}

DataType = rowDataType?.GetPropertyTypeByPath(PropertyName, DataGrid.CachingEnabled, DataGrid.CacheSize);
DataType = rowDataType?.GetPropertyTypeByPath(PropertyName);
}
catch (Exception ex)
when (ex is NotSupportedException or ArgumentNullException or InvalidCastException)
Expand Down
Loading

0 comments on commit 67278bf

Please sign in to comment.