Cogs.Collections.Synchronized 1.6.3

.NET Standard 2.1
Install-Package Cogs.Collections.Synchronized -Version 1.6.3
dotnet add package Cogs.Collections.Synchronized --version 1.6.3
<PackageReference Include="Cogs.Collections.Synchronized" Version="1.6.3" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Cogs.Collections.Synchronized --version 1.6.3
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Cogs.Collections.Synchronized, 1.6.3"
#r directive can be used in F# Interactive, C# scripting and .NET Interactive. Copy this into the interactive tool or source code of the script to reference the package.
// Install Cogs.Collections.Synchronized as a Cake Addin
#addin nuget:?package=Cogs.Collections.Synchronized&version=1.6.3

// Install Cogs.Collections.Synchronized as a Cake Tool
#tool nuget:?package=Cogs.Collections.Synchronized&version=1.6.3
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

Good idea: binding UI elements to observable collections. Bad idea: manipulating observable collections bound to UI elements from background threads. Why? Because the collection change notification event handlers will be executed on non-UI threads, which cannot safely manipulate the UI. So, I guess we need to carefully marshal calls over to the UI thread whenever we manipulate or even read those observable collections, right?

Not anymore.

Introducing the SynchronizedObservableCollection<T>, SynchronizedObservableDictionary<TKey, TValue>, and SynchronizedObservableSortedDictionary<TKey, TValue> classes. Create them on UI threads. Or, pass the UI thread's synchronization context to their constructors. Then, any time they are touched, the call is marshalled to the context of the appropriate thread. They even include async alternatives to every method and indexer just in case you would like to be well-behaved and not block worker threads just because the UI thread is busy.

I mean, no judgment. We just don't like sending threads to thread jail.

Last, but not least, each of them also has an array of range methods to handle performing multiple operations at once when you know you'll need to in advanced and would like to avoid O(2n) context switching.

Product Versions
.NET net5.0 net5.0-windows net6.0 net6.0-android net6.0-ios net6.0-maccatalyst net6.0-macos net6.0-tvos net6.0-windows
.NET Core netcoreapp3.0 netcoreapp3.1
.NET Standard netstandard2.1
MonoAndroid monoandroid
MonoMac monomac
MonoTouch monotouch
Tizen tizen60
Xamarin.iOS xamarinios
Xamarin.Mac xamarinmac
Xamarin.TVOS xamarintvos
Xamarin.WatchOS xamarinwatchos
Compatible target framework(s)
Additional computed target framework(s)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on Cogs.Collections.Synchronized:

Package Downloads
Cogs.ActiveQuery

Cogs for active queries.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.6.3 162 4/4/2022
1.6.2 121 3/27/2022
1.6.1 162 12/21/2021
1.6.0 121 12/18/2021
1.5.3 126 12/16/2021
1.5.2 142 12/16/2021
1.5.1 287 11/3/2021
1.5.0 332 7/15/2021
1.4.6 506 2/10/2021
1.4.5 241 2/1/2021
1.4.4 196 1/30/2021
1.4.3 153 1/30/2021
1.4.2 310 11/22/2020
1.4.1 682 10/20/2020
1.4.0 228 10/20/2020
1.3.1 317 10/19/2020
1.3.0 309 10/5/2020
1.2.3 1,778 5/7/2020
1.2.2 271 5/7/2020
1.2.1 425 4/17/2020
1.2.0 390 4/13/2020
1.1.2 277 4/11/2020
1.1.0 307 3/4/2020
1.0.2 497 3/4/2020
1.0.1 310 3/1/2020
1.0.0 396 2/29/2020

We upgraded NuGet references and refactored for compatibility with changes in the Collections library.