DCSIMG
IDictionary,WPF - Shimmy on .NET

Browse by Tags

All Tags » IDictionary » WPF (RSS)

ObservableDictionary<TKey, TValue> (C#) by Shimmy

Few weeks ago I posted an ObservableDictionary(Of TKey, TValue) in VB.NET, today I had some time to translate it to C# (not tested, just translated, kindly notice me for any error). using System ; using System . Linq ; using System . ComponentModel ; using System . Collections . Generic ; using System . Collections . Specialized ; namespace System . Collections . ObjectModel { public class ObservableDictionary < TKey , TValue > : IDictionary <TKey, TValue>, INotifyCollectionChanged ,...

ObservableDictionary(Of TKey, TValue) - VB.NET by Shimmy

Here you go with an ObservableDictionary<TKey, TValue> that will allow you to create a UI connected to a dictionary, getting notified on dictionary item-changes. This one supports an AddRange method that allows adding a bulk of items (will throw for existing keys) without notifying for each item (opposed to ObservableCollection<T > that doesn't). To the C# version . NOTE: This class is not tested and thus not meant to be used in a multi-threaded application. HTH, Shimmy Imports System...
Powered by Community Server (Commercial Edition), by Telligent Systems