diff --git a/components/AdvancedCollectionView/samples/AdvancedCollectionView.Samples.csproj b/components/AdvancedCollectionView/samples/AdvancedCollectionView.Samples.csproj deleted file mode 100644 index 6469f7cf..00000000 --- a/components/AdvancedCollectionView/samples/AdvancedCollectionView.Samples.csproj +++ /dev/null @@ -1,8 +0,0 @@ - - - AdvancedCollectionView - - - - - diff --git a/components/AdvancedCollectionView/samples/AdvancedCollectionView.md b/components/AdvancedCollectionView/samples/AdvancedCollectionView.md deleted file mode 100644 index 98843053..00000000 --- a/components/AdvancedCollectionView/samples/AdvancedCollectionView.md +++ /dev/null @@ -1,149 +0,0 @@ ---- -title: AdvancedCollectionView -author: nmetulev -description: The AdvancedCollectionView is a collection view implementation that support filtering, sorting and incremental loading. It's meant to be used in a viewmodel. -keywords: AdvancedCollectionView, data, sorting, filtering -dev_langs: - - csharp -category: Helpers -subcategory: Data -discussion-id: 0 -issue-id: 0 -icon: Assets/AdvancedCollectionView.png ---- - -> [!Sample AdvancedCollectionViewSample] - -## Usage - -In your viewmodel instead of having a public [IEnumerable](/dotnet/core/api/system.collections.generic.ienumerable-1) of some sort to be bound to an eg. [Listview](/uwp/api/Windows.UI.Xaml.Controls.ListView), create a public AdvancedCollectionView and pass your list in the constructor to it. If you've done that you can use the many useful features it provides: - -* sorting your list using the `SortDirection` helper: specify any number of property names to sort on with the direction desired -* filtering your list using a [Predicate](/dotnet/core/api/system.predicate-1): this will automatically filter your list only to the items that pass the check by the predicate provided -* deferring notifications using the `NotificationDeferrer` helper: with a convenient _using_ pattern you can increase performance while doing large-scale modifications in your list by waiting with updates until you've completed your work -* incremental loading: if your source collection supports the feature then AdvancedCollectionView will do as well (it simply forwards the calls) -* live shaping: when constructing the `AdvancedCollectionView` you may specify that the collection use live shaping. This means that the collection will re-filter or re-sort if there are changes to the sort properties or filter properties that are specified using `ObserveFilterProperty` - -## Example - -```csharp -using Microsoft.Toolkit.Uwp.UI; - -// Grab a sample type -public class Person -{ - public string Name { get; set; } -} - -// Set up the original list with a few sample items -var oc = new ObservableCollection -{ - new Person { Name = "Staff" }, - new Person { Name = "42" }, - new Person { Name = "Swan" }, - new Person { Name = "Orchid" }, - new Person { Name = "15" }, - new Person { Name = "Flame" }, - new Person { Name = "16" }, - new Person { Name = "Arrow" }, - new Person { Name = "Tempest" }, - new Person { Name = "23" }, - new Person { Name = "Pearl" }, - new Person { Name = "Hydra" }, - new Person { Name = "Lamp Post" }, - new Person { Name = "4" }, - new Person { Name = "Looking Glass" }, - new Person { Name = "8" }, -}; - -// Set up the AdvancedCollectionView with live shaping enabled to filter and sort the original list -var acv = new AdvancedCollectionView(oc, true); - -// Let's filter out the integers -int nul; -acv.Filter = x => !int.TryParse(((Person)x).Name, out nul); - -// And sort ascending by the property "Name" -acv.SortDescriptions.Add(new SortDescription("Name", SortDirection.Ascending)); - -// Let's add a Person to the observable collection -var person = new Person { Name = "Aardvark" }; -oc.Add(person); - -// Our added person is now at the top of the list, but if we rename this person, we can trigger a re-sort -person.Name = "Zaphod"; // Now a re-sort is triggered and person will be last in the list - -// AdvancedCollectionView can be bound to anything that uses collections. -YourListView.ItemsSource = acv; -``` - -## Properties - -| Property | Type | Description | -| -- | -- | -- | -| CanFilter | bool | Gets a value indicating whether this CollectionView can filter its items | -| CanSort | bool | Gets a value indicating whether this CollectionView can sort its items | -| CollectionGroups | IObservableVector\ | Gets the groups in collection | -| Count | int | Get the count of items | -| CurrentItem | object | Gets or sets the current item | -| CurrentPosition | int | Gets the position of current item | -| Filter | Predicate\ | Gets or sets the predicate used to filter the visible items | -| HasMoreItems | bool | Gets a value indicating whether the source has more items | -| IsCurrentAfterLast | bool | Gets a value indicating whether the current item is after the last visible item | -| IsCurrentBeforeFirst | bool | Gets a value indicating whether the current item is before the first visible item | -| IsReadOnly | bool | Get a value indicating whether this CollectionView is read only | -| SortDescriptions | IList<[SortDescription](/dotnet/api/microsoft.toolkit.uwp.ui.sortdescription)> | Gets SortDescriptions to sort the visible items | -| Source | IEnumerable | Gets or sets the source | -| SourceCollection | IEnumerable | Gets the source collection | -| this[int] | int | Gets or sets the element at the specified index | - -## Methods - -| Methods | Return Type | Description | -| -- | -- | -- | -| Add(Object) | void | Add item | -| Clear() | void | Clear item | -| Contains(Object) | bool | Returns `true` if the given item contained in CollectionView | -| B(float, string) | int | Description | -| DeferRefresh() | IDisposable | Stops refreshing until it is disposed | -| IndexOf(Object) | int | Return index of an item | -| Insert(Int32, Object) | void | Insert an item in a particular place | -| LoadMoreItemsAsync(UInt32) | IAsyncOperation<[LoadMoreItemsResult](/uwp/api/Windows.UI.Xaml.Data.LoadMoreItemsResult)> | Load more items from the source | -| MoveCurrentTo(Object) | bool | Move current index to item. Returns success of operation | -| MoveCurrentToFirst() | bool | Move current item to first item. Returns success of operation | -| MoveCurrentToLast() | bool | Move current item to last item. Returns success of operation | -| MoveCurrentToNext() | bool | Move current item to next item | -| MoveCurrentToPosition(Int32) | bool | Moves selected item to position | -| MoveCurrentToPrevious() | bool | Move current item to previous item | -| Refresh() | void | Manually refresh the view | -| Remove(Object) | bool | Remove item | -| RemoveAt(Int32) | bool | Remove item with index | - -## Events - -| Events | Description | -| -- | -- | -| CurrentChanged | Current item changed event handler | -| CurrentChanging | Current item changing event handler | -| PropertyChanged | Occurs when a property value changes | -| VectorChanged | Occurs when the vector changes | - -## Remarks - -_What source can I use?_ - -It's not necessary to use an eg. [ObservableCollection](/dotnet/core/api/system.collections.objectmodel.observablecollection-1) to use the AdvancedCollectionView. It works as expected even when providing a simple [List](/dotnet/core/api/system.collections.generic.list-1) in the constructor. - -_Any performance guidelines?_ - -If you're removing, modifying or inserting large amounts of items while having filtering and/or sorting set up, it's recommended that you use the `NotificationDeferrer` helper provided. It skips any performance heavy logic while it's in use, and automatically calls the `Refresh` method when disposed. - -```csharp -using (acv.DeferRefresh()) -{ - for (var i = 0; i < 500; i++) - { - acv.Add(new Person { Name = "defer" }); - } -} // acv.Refresh() gets called here -``` diff --git a/components/AdvancedCollectionView/OpenSolution.bat b/components/Collections/OpenSolution.bat similarity index 100% rename from components/AdvancedCollectionView/OpenSolution.bat rename to components/Collections/OpenSolution.bat diff --git a/components/Collections/samples/AdvancedCollectionView.md b/components/Collections/samples/AdvancedCollectionView.md new file mode 100644 index 00000000..dd83aae1 --- /dev/null +++ b/components/Collections/samples/AdvancedCollectionView.md @@ -0,0 +1,98 @@ +--- +title: AdvancedCollectionView +author: nmetulev +description: The AdvancedCollectionView is a collection view implementation that support filtering, sorting and incremental loading. It's meant to be used in a viewmodel. +keywords: AdvancedCollectionView, data, sorting, filtering +dev_langs: + - csharp +category: Helpers +subcategory: Data +discussion-id: 0 +issue-id: 0 +icon: Assets/AdvancedCollectionView.png +--- + +> [!Sample AdvancedCollectionViewSample] + +## Usage + +In your viewmodel instead of having a public [IEnumerable](/dotnet/core/api/system.collections.generic.ienumerable-1) of some sort to be bound to an eg. [Listview](/uwp/api/Windows.UI.Xaml.Controls.ListView), create a public AdvancedCollectionView and pass your list in the constructor to it. If you've done that you can use the many useful features it provides: + +* sorting your list using the `SortDirection` helper: specify any number of property names to sort on with the direction desired +* filtering your list using a [Predicate](/dotnet/core/api/system.predicate-1): this will automatically filter your list only to the items that pass the check by the predicate provided +* deferring notifications using the `NotificationDeferrer` helper: with a convenient _using_ pattern you can increase performance while doing large-scale modifications in your list by waiting with updates until you've completed your work +* incremental loading: if your source collection supports the feature then AdvancedCollectionView will do as well (it simply forwards the calls) +* live shaping: when constructing the `AdvancedCollectionView` you may specify that the collection use live shaping. This means that the collection will re-filter or re-sort if there are changes to the sort properties or filter properties that are specified using `ObserveFilterProperty` + +## Example + +```csharp +using Microsoft.Toolkit.Uwp.UI; + +// Grab a sample type +public class Person +{ + public string Name { get; set; } +} + +// Set up the original list with a few sample items +var oc = new ObservableCollection +{ + new Person { Name = "Staff" }, + new Person { Name = "42" }, + new Person { Name = "Swan" }, + new Person { Name = "Orchid" }, + new Person { Name = "15" }, + new Person { Name = "Flame" }, + new Person { Name = "16" }, + new Person { Name = "Arrow" }, + new Person { Name = "Tempest" }, + new Person { Name = "23" }, + new Person { Name = "Pearl" }, + new Person { Name = "Hydra" }, + new Person { Name = "Lamp Post" }, + new Person { Name = "4" }, + new Person { Name = "Looking Glass" }, + new Person { Name = "8" }, +}; + +// Set up the AdvancedCollectionView with live shaping enabled to filter and sort the original list +var acv = new AdvancedCollectionView(oc, true); + +// Let's filter out the integers +int nul; +acv.Filter = x => !int.TryParse(((Person)x).Name, out nul); + +// And sort ascending by the property "Name" +acv.SortDescriptions.Add(new SortDescription("Name", SortDirection.Ascending)); + +// Let's add a Person to the observable collection +var person = new Person { Name = "Aardvark" }; +oc.Add(person); + +// Our added person is now at the top of the list, but if we rename this person, we can trigger a re-sort +person.Name = "Zaphod"; // Now a re-sort is triggered and person will be last in the list + +// AdvancedCollectionView can be bound to anything that uses collections. +YourListView.ItemsSource = acv; +``` + +## Remarks + +_What source can I use?_ + +It's not necessary to use an eg. [ObservableCollection](/dotnet/core/api/system.collections.objectmodel.observablecollection-1) to use the AdvancedCollectionView. It works as expected even when providing a simple [List](/dotnet/core/api/system.collections.generic.list-1) in the constructor. + +_Any performance guidelines?_ + +If you're removing, modifying or inserting large amounts of items while having filtering and/or sorting set up, it's recommended that you use the `NotificationDeferrer` helper provided. It skips any performance heavy logic while it's in use, and automatically calls the `Refresh` method when disposed. + +```csharp +using (acv.DeferRefresh()) +{ + for (var i = 0; i < 500; i++) + { + acv.Add(new Person { Name = "defer" }); + } +} // acv.Refresh() gets called here +``` diff --git a/components/AdvancedCollectionView/samples/AdvancedCollectionViewSample.xaml b/components/Collections/samples/AdvancedCollectionViewSample.xaml similarity index 97% rename from components/AdvancedCollectionView/samples/AdvancedCollectionViewSample.xaml rename to components/Collections/samples/AdvancedCollectionViewSample.xaml index 15060922..52800777 100644 --- a/components/AdvancedCollectionView/samples/AdvancedCollectionViewSample.xaml +++ b/components/Collections/samples/AdvancedCollectionViewSample.xaml @@ -1,5 +1,5 @@  - - IncrementalLoadingCollection + Collections diff --git a/components/AdvancedCollectionView/samples/Dependencies.props b/components/Collections/samples/Dependencies.props similarity index 100% rename from components/AdvancedCollectionView/samples/Dependencies.props rename to components/Collections/samples/Dependencies.props diff --git a/components/IncrementalLoadingCollection/samples/IncrementalLoadingCollection.md b/components/Collections/samples/IncrementalLoadingCollection.md similarity index 61% rename from components/IncrementalLoadingCollection/samples/IncrementalLoadingCollection.md rename to components/Collections/samples/IncrementalLoadingCollection.md index dca336aa..ba8d42d2 100644 --- a/components/IncrementalLoadingCollection/samples/IncrementalLoadingCollection.md +++ b/components/Collections/samples/IncrementalLoadingCollection.md @@ -18,27 +18,6 @@ icon: Assets/IncrementalLoadingCollection.png [IncrementalLoadingCollection](/dotnet/api/microsoft.toolkit.uwp.incrementalloadingcollection-2) - An extension of [ObservableCollection](/dotnet/api/system.collections.objectmodel.observablecollection-1) such that its items are loaded only when needed. -## IncrementalLoadingCollection Properties - -| Property | Type | Description | -| -- | -- | -- | -| CurrentPageIndex | int | Gets or sets a value indicating The zero-based index of the current items page | -| HasMoreItems | bool | Gets a value indicating whether the collection contains more items to retrieve | -| IsLoading | bool | Gets a value indicating whether new items are being loaded | -| ItemsPerPage | int | Gets a value indicating how many items that must be retrieved for each incremental call | -| OnEndLoading | [Action](/dotnet/api/system.action) | Gets or sets an Action that is called when a retrieval operation ends | -| OnError | Action\ | Gets or sets an Action that is called if an error occours during data retrieval. The actual Exception is passed as an argument | -| OnStartLoading | Action | Gets or sets an Action that is called when a retrieval operation begins | - -## IncrementalLoadingCollection Methods - -| Methods | Return Type | Description | -| -- | -- | -- | -| LoadDataAsync(CancellationToken) | Task> | Actually performs the incremental loading | -| LoadMoreItemsAsync(UInt32) | IAsyncOperation\ | Initializes incremental loading from the view | -| Refresh() | void | Clears the collection and resets the page index which triggers an automatic reload of the first page | -| RefreshAsync() | Task | Clears the collection and reloads data from the source | - ## Example `IIncrementalSource` allows to define the data source: diff --git a/components/IncrementalLoadingCollection/samples/IncrementalLoadingCollectionSample.xaml b/components/Collections/samples/IncrementalLoadingCollectionSample.xaml similarity index 96% rename from components/IncrementalLoadingCollection/samples/IncrementalLoadingCollectionSample.xaml rename to components/Collections/samples/IncrementalLoadingCollectionSample.xaml index e1b4438f..d18700cd 100644 --- a/components/IncrementalLoadingCollection/samples/IncrementalLoadingCollectionSample.xaml +++ b/components/Collections/samples/IncrementalLoadingCollectionSample.xaml @@ -1,5 +1,5 @@  -(); + PeopleListView.ItemsSource = collection; + + // Binds the collection to the page DataContext in order to use its IsLoading and HasMoreItems properties. + DataContext = collection; + } + + private async void RefreshCollection(object sender, RoutedEventArgs e) + { + var collection = (IncrementalLoadingCollection)PeopleListView.ItemsSource; + await collection.RefreshAsync(); + } +} /// /// A sample implementation of the interface. @@ -65,3 +90,14 @@ public PeopleSource() return result; } } + +/// +/// A sample class used to show how to use the interface. +/// +public class Person +{ + /// + /// Gets or sets the name of the person. + /// + public string? Name { get; set; } +} diff --git a/components/AdvancedCollectionView/src/AdditionalAssemblyInfo.cs b/components/Collections/src/AdditionalAssemblyInfo.cs similarity index 79% rename from components/AdvancedCollectionView/src/AdditionalAssemblyInfo.cs rename to components/Collections/src/AdditionalAssemblyInfo.cs index 5f8cb7e3..07f1c63e 100644 --- a/components/AdvancedCollectionView/src/AdditionalAssemblyInfo.cs +++ b/components/Collections/src/AdditionalAssemblyInfo.cs @@ -7,7 +7,7 @@ // These `InternalsVisibleTo` calls are intended to make it easier for // for any internal code to be testable in all the different test projects // used with the Labs infrastructure. -[assembly: InternalsVisibleTo("AdvancedCollectionView.Tests.Uwp")] -[assembly: InternalsVisibleTo("AdvancedCollectionView.Tests.WinAppSdk")] +[assembly: InternalsVisibleTo("Collections.Tests.Uwp")] +[assembly: InternalsVisibleTo("Collections.Tests.WinAppSdk")] [assembly: InternalsVisibleTo("CommunityToolkit.Tests.Uwp")] [assembly: InternalsVisibleTo("CommunityToolkit.Tests.WinAppSdk")] diff --git a/components/AdvancedCollectionView/src/AdvancedCollectionView.Defer.cs b/components/Collections/src/AdvancedCollectionView/AdvancedCollectionView.Defer.cs similarity index 100% rename from components/AdvancedCollectionView/src/AdvancedCollectionView.Defer.cs rename to components/Collections/src/AdvancedCollectionView/AdvancedCollectionView.Defer.cs diff --git a/components/AdvancedCollectionView/src/AdvancedCollectionView.Events.cs b/components/Collections/src/AdvancedCollectionView/AdvancedCollectionView.Events.cs similarity index 100% rename from components/AdvancedCollectionView/src/AdvancedCollectionView.Events.cs rename to components/Collections/src/AdvancedCollectionView/AdvancedCollectionView.Events.cs diff --git a/components/AdvancedCollectionView/src/AdvancedCollectionView.cs b/components/Collections/src/AdvancedCollectionView/AdvancedCollectionView.cs similarity index 100% rename from components/AdvancedCollectionView/src/AdvancedCollectionView.cs rename to components/Collections/src/AdvancedCollectionView/AdvancedCollectionView.cs diff --git a/components/AdvancedCollectionView/src/IAdvancedCollectionView.cs b/components/Collections/src/AdvancedCollectionView/IAdvancedCollectionView.cs similarity index 100% rename from components/AdvancedCollectionView/src/IAdvancedCollectionView.cs rename to components/Collections/src/AdvancedCollectionView/IAdvancedCollectionView.cs diff --git a/components/AdvancedCollectionView/src/SortDescription.cs b/components/Collections/src/AdvancedCollectionView/SortDescription.cs similarity index 100% rename from components/AdvancedCollectionView/src/SortDescription.cs rename to components/Collections/src/AdvancedCollectionView/SortDescription.cs diff --git a/components/AdvancedCollectionView/src/SortDirection.cs b/components/Collections/src/AdvancedCollectionView/SortDirection.cs similarity index 100% rename from components/AdvancedCollectionView/src/SortDirection.cs rename to components/Collections/src/AdvancedCollectionView/SortDirection.cs diff --git a/components/AdvancedCollectionView/src/VectorChangedEventArgs.cs b/components/Collections/src/AdvancedCollectionView/VectorChangedEventArgs.cs similarity index 100% rename from components/AdvancedCollectionView/src/VectorChangedEventArgs.cs rename to components/Collections/src/AdvancedCollectionView/VectorChangedEventArgs.cs diff --git a/components/AdvancedCollectionView/src/CommunityToolkit.WinUI.AdvancedCollectionView.csproj b/components/Collections/src/CommunityToolkit.WinUI.Collections.csproj similarity index 66% rename from components/AdvancedCollectionView/src/CommunityToolkit.WinUI.AdvancedCollectionView.csproj rename to components/Collections/src/CommunityToolkit.WinUI.Collections.csproj index 91426b29..f5948a05 100644 --- a/components/AdvancedCollectionView/src/CommunityToolkit.WinUI.AdvancedCollectionView.csproj +++ b/components/Collections/src/CommunityToolkit.WinUI.Collections.csproj @@ -1,17 +1,17 @@ - AdvancedCollectionView - This package contains AdvancedCollectionView. + Collections + This package contains the AdvancedCollectionView and IncrementalLoadingCollection. 8.0.0-beta.1 - CommunityToolkit.WinUI.AdvancedCollectionViewRns + CommunityToolkit.WinUI.CollectionsRns - + diff --git a/components/AdvancedCollectionView/src/Dependencies.props b/components/Collections/src/Dependencies.props similarity index 100% rename from components/AdvancedCollectionView/src/Dependencies.props rename to components/Collections/src/Dependencies.props diff --git a/components/IncrementalLoadingCollection/src/IIncrementalSource.cs b/components/Collections/src/IncrementalLoadingCollection/IIncrementalSource.cs similarity index 100% rename from components/IncrementalLoadingCollection/src/IIncrementalSource.cs rename to components/Collections/src/IncrementalLoadingCollection/IIncrementalSource.cs diff --git a/components/IncrementalLoadingCollection/src/IncrementalLoadingCollection.cs b/components/Collections/src/IncrementalLoadingCollection/IncrementalLoadingCollection.cs similarity index 100% rename from components/IncrementalLoadingCollection/src/IncrementalLoadingCollection.cs rename to components/Collections/src/IncrementalLoadingCollection/IncrementalLoadingCollection.cs diff --git a/components/AdvancedCollectionView/src/MultiTarget.props b/components/Collections/src/MultiTarget.props similarity index 100% rename from components/AdvancedCollectionView/src/MultiTarget.props rename to components/Collections/src/MultiTarget.props diff --git a/components/AdvancedCollectionView/tests/AdvancedCollectionView.Tests.projitems b/components/Collections/tests/Collections.Tests.projitems similarity index 64% rename from components/AdvancedCollectionView/tests/AdvancedCollectionView.Tests.projitems rename to components/Collections/tests/Collections.Tests.projitems index 4a0d41fc..e99972f6 100644 --- a/components/AdvancedCollectionView/tests/AdvancedCollectionView.Tests.projitems +++ b/components/Collections/tests/Collections.Tests.projitems @@ -3,12 +3,14 @@ $(MSBuildAllProjects);$(MSBuildThisFileFullPath) true - 6E4FBFA1-F823-455E-B13F-B72991D64931 + B5DDFE59-3189-4B41-BE43-C90F53367C94 - AdvancedCollectionViewExperiment.Tests + CollectionsExperiment.Tests + + \ No newline at end of file diff --git a/components/AdvancedCollectionView/tests/AdvancedCollectionView.Tests.shproj b/components/Collections/tests/Collections.Tests.shproj similarity index 86% rename from components/AdvancedCollectionView/tests/AdvancedCollectionView.Tests.shproj rename to components/Collections/tests/Collections.Tests.shproj index aa515ca8..f03f6f12 100644 --- a/components/AdvancedCollectionView/tests/AdvancedCollectionView.Tests.shproj +++ b/components/Collections/tests/Collections.Tests.shproj @@ -1,13 +1,13 @@ - 6E4FBFA1-F823-455E-B13F-B72991D64931 + B5DDFE59-3189-4B41-BE43-C90F53367C94 14.0 - + diff --git a/components/IncrementalLoadingCollection/tests/DataSource.cs b/components/Collections/tests/DataSource.cs similarity index 97% rename from components/IncrementalLoadingCollection/tests/DataSource.cs rename to components/Collections/tests/DataSource.cs index 5ddf6400..b4846e59 100644 --- a/components/IncrementalLoadingCollection/tests/DataSource.cs +++ b/components/Collections/tests/DataSource.cs @@ -2,7 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. -namespace IncrementalLoadingCollectionExperiment.Tests; +namespace CollectionsExperiment.Tests; public class DataSource : IIncrementalSource { diff --git a/components/AdvancedCollectionView/tests/Test_AdvancedCollectionView.cs b/components/Collections/tests/Test_AdvancedCollectionView.cs similarity index 98% rename from components/AdvancedCollectionView/tests/Test_AdvancedCollectionView.cs rename to components/Collections/tests/Test_AdvancedCollectionView.cs index 92131c3e..78a2e786 100644 --- a/components/AdvancedCollectionView/tests/Test_AdvancedCollectionView.cs +++ b/components/Collections/tests/Test_AdvancedCollectionView.cs @@ -4,7 +4,7 @@ using System.Runtime.CompilerServices; -namespace AdvancedCollectionViewExperiment.Tests; +namespace CollectionsExperiment.Tests; [TestClass] public class Test_AdvancedCollectionView diff --git a/components/IncrementalLoadingCollection/tests/Test_IncrementalLoadingCollection.cs b/components/Collections/tests/Test_IncrementalLoadingCollection.cs similarity index 98% rename from components/IncrementalLoadingCollection/tests/Test_IncrementalLoadingCollection.cs rename to components/Collections/tests/Test_IncrementalLoadingCollection.cs index 3c049595..97f38ba8 100644 --- a/components/IncrementalLoadingCollection/tests/Test_IncrementalLoadingCollection.cs +++ b/components/Collections/tests/Test_IncrementalLoadingCollection.cs @@ -2,7 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. -namespace IncrementalLoadingCollectionExperiment.Tests; +namespace CollectionsExperiment.Tests; [TestClass] public class Test_IncrementalLoadingCollection diff --git a/components/IncrementalLoadingCollection/OpenSolution.bat b/components/IncrementalLoadingCollection/OpenSolution.bat deleted file mode 100644 index 814a56d4..00000000 --- a/components/IncrementalLoadingCollection/OpenSolution.bat +++ /dev/null @@ -1,3 +0,0 @@ -@ECHO OFF - -powershell ..\..\tooling\ProjectHeads\GenerateSingleSampleHeads.ps1 -componentPath %CD% %* \ No newline at end of file diff --git a/components/IncrementalLoadingCollection/samples/Dependencies.props b/components/IncrementalLoadingCollection/samples/Dependencies.props deleted file mode 100644 index e622e1df..00000000 --- a/components/IncrementalLoadingCollection/samples/Dependencies.props +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - diff --git a/components/IncrementalLoadingCollection/samples/IncrementalLoadingCollectionSample.xaml.cs b/components/IncrementalLoadingCollection/samples/IncrementalLoadingCollectionSample.xaml.cs deleted file mode 100644 index 80035f97..00000000 --- a/components/IncrementalLoadingCollection/samples/IncrementalLoadingCollectionSample.xaml.cs +++ /dev/null @@ -1,32 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -using CommunityToolkit.WinUI; - -namespace IncrementalLoadingCollectionExperiment.Samples; - -[ToolkitSample(id: nameof(IncrementalLoadingCollectionSample), "Incremental Loading Collection", description: $"A sample for showing how to create and use a IncrementalLoadingCollection.")] -public sealed partial class IncrementalLoadingCollectionSample : Page -{ - public IncrementalLoadingCollectionSample() - { - this.InitializeComponent(); - Load(); - } - private void Load() - { - // IncrementalLoadingCollection can be bound to a GridView or a ListView. In this case it is a ListView called PeopleListView. - var collection = new IncrementalLoadingCollection(); - PeopleListView.ItemsSource = collection; - - // Binds the collection to the page DataContext in order to use its IsLoading and HasMoreItems properties. - DataContext = collection; - } - - private async void RefreshCollection(object sender, RoutedEventArgs e) - { - var collection = (IncrementalLoadingCollection)PeopleListView.ItemsSource; - await collection.RefreshAsync(); - } -} diff --git a/components/IncrementalLoadingCollection/samples/Person.cs b/components/IncrementalLoadingCollection/samples/Person.cs deleted file mode 100644 index b30265c9..00000000 --- a/components/IncrementalLoadingCollection/samples/Person.cs +++ /dev/null @@ -1,16 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -namespace IncrementalLoadingCollectionExperiment.Samples; - -/// -/// A sample class used to show how to use the interface. -/// -public class Person -{ - /// - /// Gets or sets the name of the person. - /// - public string? Name { get; set; } -} diff --git a/components/IncrementalLoadingCollection/src/AdditionalAssemblyInfo.cs b/components/IncrementalLoadingCollection/src/AdditionalAssemblyInfo.cs deleted file mode 100644 index 152eadae..00000000 --- a/components/IncrementalLoadingCollection/src/AdditionalAssemblyInfo.cs +++ /dev/null @@ -1,13 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -using System.Runtime.CompilerServices; - -// These `InternalsVisibleTo` calls are intended to make it easier for -// for any internal code to be testable in all the different test projects -// used with the Labs infrastructure. -[assembly: InternalsVisibleTo("IncrementalLoadingCollection.Tests.Uwp")] -[assembly: InternalsVisibleTo("IncrementalLoadingCollection.Tests.WinAppSdk")] -[assembly: InternalsVisibleTo("CommunityToolkit.Tests.Uwp")] -[assembly: InternalsVisibleTo("CommunityToolkit.Tests.WinAppSdk")] diff --git a/components/IncrementalLoadingCollection/src/CommunityToolkit.WinUI.IncrementalLoadingCollection.csproj b/components/IncrementalLoadingCollection/src/CommunityToolkit.WinUI.IncrementalLoadingCollection.csproj deleted file mode 100644 index 397d4d8c..00000000 --- a/components/IncrementalLoadingCollection/src/CommunityToolkit.WinUI.IncrementalLoadingCollection.csproj +++ /dev/null @@ -1,13 +0,0 @@ - - - IncrementalLoadingCollection - This package contains IncrementalLoadingCollection. - 0.0.1 - - - CommunityToolkit.WinUI.IncrementalLoadingCollectionRns - - - - - diff --git a/components/IncrementalLoadingCollection/src/Dependencies.props b/components/IncrementalLoadingCollection/src/Dependencies.props deleted file mode 100644 index e622e1df..00000000 --- a/components/IncrementalLoadingCollection/src/Dependencies.props +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - diff --git a/components/IncrementalLoadingCollection/src/MultiTarget.props b/components/IncrementalLoadingCollection/src/MultiTarget.props deleted file mode 100644 index b11c1942..00000000 --- a/components/IncrementalLoadingCollection/src/MultiTarget.props +++ /dev/null @@ -1,9 +0,0 @@ - - - - uwp;wasdk;wpf;wasm;linuxgtk;macos;ios;android; - - \ No newline at end of file diff --git a/components/IncrementalLoadingCollection/tests/IncrementalLoadingCollection.Tests.projitems b/components/IncrementalLoadingCollection/tests/IncrementalLoadingCollection.Tests.projitems deleted file mode 100644 index 2e57037f..00000000 --- a/components/IncrementalLoadingCollection/tests/IncrementalLoadingCollection.Tests.projitems +++ /dev/null @@ -1,15 +0,0 @@ - - - - $(MSBuildAllProjects);$(MSBuildThisFileFullPath) - true - D1181822-7162-459C-B40E-591420DC438F - - - IncrementalLoadingCollectionExperiment.Tests - - - - - - \ No newline at end of file diff --git a/components/IncrementalLoadingCollection/tests/IncrementalLoadingCollection.Tests.shproj b/components/IncrementalLoadingCollection/tests/IncrementalLoadingCollection.Tests.shproj deleted file mode 100644 index a3734868..00000000 --- a/components/IncrementalLoadingCollection/tests/IncrementalLoadingCollection.Tests.shproj +++ /dev/null @@ -1,13 +0,0 @@ - - - - D1181822-7162-459C-B40E-591420DC438F - 14.0 - - - - - - - -