DataFilter.PlatformShared
1.1.2
See the version list below for details.
dotnet add package DataFilter.PlatformShared --version 1.1.2
NuGet\Install-Package DataFilter.PlatformShared -Version 1.1.2
<PackageReference Include="DataFilter.PlatformShared" Version="1.1.2" />
<PackageVersion Include="DataFilter.PlatformShared" Version="1.1.2" />
<PackageReference Include="DataFilter.PlatformShared" />
paket add DataFilter.PlatformShared --version 1.1.2
#r "nuget: DataFilter.PlatformShared, 1.1.2"
#:package DataFilter.PlatformShared@1.1.2
#addin nuget:?package=DataFilter.PlatformShared&version=1.1.2
#tool nuget:?package=DataFilter.PlatformShared&version=1.1.2
DataFilter.PlatformShared
Shared view-model logic for DataFilter UI specializations (WinForms, MAUI, WinUI 3, WPF adapters, Blazor grid).
NuGet integration
Install the package
dotnet add package DataFilter.PlatformShared
Target frameworks
net8.0, net9.0
Dependencies
DataFilter.CoreDataFilter.Filtering.ExcelLikeDataFilter.LocalizationCommunityToolkit.Mvvm
Add a UI package (DataFilter.Wpf, DataFilter.Blazor, …) for controls; use PlatformShared alone when wiring your own grid.
Quick start
using DataFilter.Core.Enums;
using DataFilter.Core.Models;
using DataFilter.Core.Services;
using DataFilter.PlatformShared.ViewModels;
var grid = new FilterableDataGridViewModel<Employee>
{
LocalDataSource = employees
};
await grid.RefreshDataAsync();
// Apply a pipeline preset (filters + sort) edited in memory
var snapshot = grid.CreateFilterPipelineSnapshot();
FilterPipelineSnapshotEditor.AddRootCriterion(snapshot, "Department", nameof(FilterOperator.Equals), "IT");
await grid.ApplyFilterPipelineSnapshotAsync(snapshot);
Localization
All popup UI stacks source user-facing strings from DataFilter.Localization.LocalizationManager.
Per-grid culture override
IFilterableDataGridViewModel exposes CultureInfo? CultureOverride. Constructors:
new FilterableDataGridViewModel(cultureOverride)new FilterableDataGridViewModel<T>(cultureOverride)
Filter pipeline integration
IFilterableDataGridViewModel includes:
Task ApplyFilterPipelineAsync(FilterPipeline pipeline)— compiles the pipeline, callsFilterContext.ReplaceDescriptors, resets page to 1, and refreshes data.FilterPipeline CreatePipelineFromCurrentSnapshot()— mutable pipeline from current filters viaFilterPipelineInterop.FromLegacySnapshot(ExtractSnapshot()).FilterPipelineSnapshot CreateFilterPipelineSnapshot()/ApplyFilterPipelineSnapshotAsync— in-memory preset round-trip (filters + orderedSortEntries). JSON is optional via your own serializer.Task ApplyPipelineSessionAsync()— applies live edits onPipelineSession.PipelineandPipelineSession.SortEntrieswithout building a snapshot.FilterPipelineSnapshotEditor(Core) — helpers to mutate a snapshot before apply (AddRootCriterion,AddSort,RemoveNode, …).
// Direct list edits (no JSON)
var snapshot = grid.CreateFilterPipelineSnapshot();
FilterPipelineSnapshotEditor.AddSort(snapshot, "Name");
FilterPipelineSnapshotEditor.AddRootCriterion(snapshot, "Department", nameof(FilterOperator.Equals), "IT");
await grid.ApplyFilterPipelineSnapshotAsync(snapshot);
// Or mutate session lists, then apply
grid.PipelineSession.SortEntries.Add(new SortSnapshotEntry { PropertyName = "Name" });
await grid.ApplyPipelineSessionAsync();
Excel-style column filters continue to use ApplyColumnFilter / ClearColumnFilter (AddOrUpdateDescriptor under the hood). Mixing both approaches is possible but treat one path as the source of truth per screen, or sync explicitly.
Active filters bar (optional UI)
IFilterableDataGridViewModel exposes:
FilterPipelineSession PipelineSession— live pipeline with stable node IDs (synced from context).FilterBarViewModel FilterBar— chips, AND/OR layout, enable/disable, remove, + (add AND criterion on the same cluster), and OR+ (add a new OR group).ApplyBarCriterionAsync/RemoveBarNodeAsync— targeted edits from the bar popup.
Each UI package provides a default bar control (hidden by default). Enable with ShowFilterBar="True":
| Stack | Chrome host (bar + popup wiring) | Bar control alone |
|---|---|---|
| WPF | FilterGridChrome |
FilterBar |
| Blazor | DataFilterGrid |
FilterBar |
| WinForms | FilterGridChromeControl |
FilterBarControl |
| WinUI 3 | FilterGridChrome |
FilterBarControl |
| MAUI | FilterGridChromeView |
FilterBarView |
Prefer the chrome host so bar edits open the column popup with pipeline apply/remove semantics.
Interactions: left-click chip → column popup (single criterion); right-click → toggle enabled; × or Clear → remove node; + → add AND sibling; OR+ → add a new AND group. Set FilterPipeline.RootCombineOperator to Or when a second group is added.
Drag and drop: drag a chip onto another cluster to move the criterion; drag onto an OR separator to detach into its own OR branch. Uses FilterPipelineEditor.MoveCriterionToCluster / MoveCriterionToOrGap.
Example JSON (two OR groups + sort):
{
"schemaVersion": 1,
"rootCombineOperator": "Or",
"nodes": [
{
"kind": "group",
"logicalOperator": "And",
"children": [
{ "kind": "criterion", "propertyName": "Department", "operator": "Equals", "value": "IT" },
{ "kind": "criterion", "propertyName": "Name", "operator": "StartsWith", "value": "Alice" }
]
},
{
"kind": "group",
"logicalOperator": "And",
"children": [
{ "kind": "criterion", "propertyName": "Department", "operator": "Equals", "value": "RH" },
{ "kind": "criterion", "propertyName": "Name", "operator": "StartsWith", "value": "Bob" }
]
}
],
"sortEntries": [
{ "propertyName": "Name", "isDescending": false },
{ "propertyName": "Department", "isDescending": true }
]
}
FilterableDataGridViewModel and column popup sync
IFilterableDataGridViewModel.FilterDescriptorsChanged: Raised when the pipeline is applied/restored, when a column is cleared, and—on the local data path—whenLocalDataSourcereference changes afterRefreshDataAsync.RefreshDataAsync: ReconcilesExcelFilterDescriptor.State.SelectedValuesagainst distincts from the current source. Assign a newLocalDataSourcethen callRefreshDataAsync.ColumnFilterViewModel: AppliesExcelFilterSelectionReconcilerinInitializeAsyncwithdropSelectionsNotInDistinct: false.LoadStateAsyncrestores list selection or, for custom filters,UpdateSelectionFromCustomFilter(including stackedAdditionalCustomCriteria).
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net8.0
- CommunityToolkit.Mvvm (>= 8.4.2)
- DataFilter.Core (>= 1.1.2)
- DataFilter.Filtering.ExcelLike (>= 1.1.2)
- DataFilter.Localization (>= 1.1.2)
-
net9.0
- CommunityToolkit.Mvvm (>= 8.4.2)
- DataFilter.Core (>= 1.1.2)
- DataFilter.Filtering.ExcelLike (>= 1.1.2)
- DataFilter.Localization (>= 1.1.2)
NuGet packages (11)
Showing the top 5 NuGet packages that depend on DataFilter.PlatformShared:
| Package | Downloads |
|---|---|
|
DataFilter.Wpf
Package Description |
|
|
DataFilter.Blazor.PopupHost
Package Description |
|
|
DataFilter.WinUI3
Package Description |
|
|
DataFilter.Maui
Package Description |
|
|
DataFilter.WinForms
Package Description |
GitHub repositories
This package is not used by any popular GitHub repositories.