DataFilter.PlatformShared 1.1.2

There is a newer version of this package available.
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
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="DataFilter.PlatformShared" Version="1.1.2" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="DataFilter.PlatformShared" Version="1.1.2" />
                    
Directory.Packages.props
<PackageReference Include="DataFilter.PlatformShared" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add DataFilter.PlatformShared --version 1.1.2
                    
#r "nuget: DataFilter.PlatformShared, 1.1.2"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package DataFilter.PlatformShared@1.1.2
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=DataFilter.PlatformShared&version=1.1.2
                    
Install as a Cake Addin
#tool nuget:?package=DataFilter.PlatformShared&version=1.1.2
                    
Install as a Cake Tool

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.Core
  • DataFilter.Filtering.ExcelLike
  • DataFilter.Localization
  • CommunityToolkit.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, calls FilterContext.ReplaceDescriptors, resets page to 1, and refreshes data.
  • FilterPipeline CreatePipelineFromCurrentSnapshot() — mutable pipeline from current filters via FilterPipelineInterop.FromLegacySnapshot(ExtractSnapshot()).
  • FilterPipelineSnapshot CreateFilterPipelineSnapshot() / ApplyFilterPipelineSnapshotAsync — in-memory preset round-trip (filters + ordered SortEntries). JSON is optional via your own serializer.
  • Task ApplyPipelineSessionAsync() — applies live edits on PipelineSession.Pipeline and PipelineSession.SortEntries without 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—when LocalDataSource reference changes after RefreshDataAsync.
  • RefreshDataAsync: Reconciles ExcelFilterDescriptor.State.SelectedValues against distincts from the current source. Assign a new LocalDataSource then call RefreshDataAsync.
  • ColumnFilterViewModel: Applies ExcelFilterSelectionReconciler in InitializeAsync with dropSelectionsNotInDistinct: false. LoadStateAsync restores list selection or, for custom filters, UpdateSelectionFromCustomFilter (including stacked AdditionalCustomCriteria).
Product 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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.

Version Downloads Last Updated
1.1.4 216 6/9/2026
1.1.3 194 6/8/2026
1.1.2 187 6/8/2026
1.1.1 179 6/5/2026
1.1.0 208 6/4/2026