Skip to content

Instantly share code, notes, and snippets.

@shawnoster
Created February 15, 2012 02:17
Show Gist options
  • Save shawnoster/1832576 to your computer and use it in GitHub Desktop.
Save shawnoster/1832576 to your computer and use it in GitHub Desktop.
An extension method that converts an Enumerable to an ObservableCollection
using System.Collections.Generic;
using System.Collections.ObjectModel;
namespace Librarian.Common
{
public static class Enumerable
{
public static ObservableCollection<TSource> ToObservable<TSource>(this IEnumerable<TSource> source)
{
return new ObservableCollection<TSource>(source);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment