Skip to content

Instantly share code, notes, and snippets.

Created Apr 17, 2015
What would you like to do?
using System.Windows;
namespace PageableListBox
public partial class MainWindow : Window
public MainWindow()
DataContext = new MainWindowVm();
<Window x:Class="PageableListBox.MainWindow"
Title="MainWindow" Height="350" Width="525">
<ListBox ItemsSource="{Binding Items}" />
using System;
using System.Reactive.Linq;
using DynamicData;
using DynamicData.Binding;
using DynamicData.Controllers;
namespace PageableListBox
public class MainWindowVm
public ObservableCollectionExtended<MyVm> Items { get; set; }
public MainWindowVm()
var myCache = new SourceCache<MyVm, string>(myobject => myobject.Id);
//this is an extension of observable collection optimised for dynamic data
Items = new ObservableCollectionExtended<MyVm>();
//these controllers enable dynamically changing filter, sort and page
var pageController = new PageController();
var filterController = new FilterController<MyVm>();
var sortController = new SortController<MyVm>(SortExpressionComparer<MyVm>.Ascending(t => t.Id));
var mySubscription = myCache.Connect()
myCache.AddOrUpdate(new MyVm("1"));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment