Target Frameworks

  • .NET Framework 4.5
  • Silverlight 4 and higher
  • Windows Phone 7.5 and higher
  • .NET for Windows Store apps

Quick Start

NOTE: this is out-dated, but will be updated shortly.

// from UI-thread, to get proper SyncrhonizationContext
var context = SynchronizationContext.Current;
var orders = new ObservableKeyedCollection<int, IOrder>(o => o.OrderID, context); 

// optional automatic sorting
IComparer<IOrder> comparer = new OrderComparer();
orders.SortComparer = comparer;

// add item from any thread
orders.Add(new Order());
Task.Factory.StartNew(() => orders.Add(new Order()));

// add or update based on key
orders.AddOrUpdate(newOrOldOrder);


Last edited Mar 21, 2013 at 8:15 PM by t2, version 4

Comments

No comments yet.