FrameworkExtensions.PresentationCore 1.0.0.35

There is a newer version of this package available.
See the version list below for details.
dotnet add package FrameworkExtensions.PresentationCore --version 1.0.0.35
                    
NuGet\Install-Package FrameworkExtensions.PresentationCore -Version 1.0.0.35
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="FrameworkExtensions.PresentationCore" Version="1.0.0.35" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="FrameworkExtensions.PresentationCore" Version="1.0.0.35" />
                    
Directory.Packages.props
<PackageReference Include="FrameworkExtensions.PresentationCore" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add FrameworkExtensions.PresentationCore --version 1.0.0.35
                    
#r "nuget: FrameworkExtensions.PresentationCore, 1.0.0.35"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package FrameworkExtensions.PresentationCore@1.0.0.35
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=FrameworkExtensions.PresentationCore&version=1.0.0.35
                    
Install as a Cake Addin
#tool nuget:?package=FrameworkExtensions.PresentationCore&version=1.0.0.35
                    
Install as a Cake Tool

Extensions to WPF

Build Tests

Last Commit NuGet Version License

Extension methods and utilities for Windows Presentation Foundation (WPF).


Extension Methods

ItemCollection Extensions (ItemCollection)

  • GetElementByName(string name) - Finds a FrameworkElement by its Name property
  • AddRange(IEnumerable items) - Adds multiple items to the collection

Selector Extensions (Selector)

  • TryCastSelectedValue<TType>(ref TType value) - Safely casts the SelectedValue to a specified type
    • Returns true on success, false on InvalidCastException

DispatcherObject Extensions (DispatcherObject)

Thread-safe invocation for WPF controls

  • SafelyInvoke(Action action, bool async = false, DispatcherPriority dispatcherPriority = Normal) - Invokes action on dispatcher thread if needed
    • Returns true if executed on current thread, false if dispatched
    • Supports both synchronous and asynchronous invocation
  • Async(Action action) - Executes action in another thread
    • If on GUI thread, uses BeginInvoke to run in background
    • If already on background thread, executes action directly
    • Returns true if invoked from background thread, false if from GUI thread

Image Extensions (System.Drawing.Image)

GDI+ to WPF conversion (only on .NET Framework, not .NET Core/5+)

  • ToBitmapImage() - Converts System.Drawing.Image to WPF BitmapImage
    • Uses PNG format for conversion via MemoryStream
    • Returns BitmapImage with CacheOption.OnLoad

Event Extensions (EventHandler<T>, MulticastDelegate)

Safe event invocation with dispatcher support

  • SafeInvoke<T>(object sender, T eventArgs) - Invokes event handlers on their appropriate threads
    • Automatically uses dispatcher for DispatcherObject targets
    • Synchronous invocation
  • SafeInvoke(params object[] arguments) - MulticastDelegate version with parameter array
  • AsyncSafeInvoke<T>(object sender, T eventArgs) - Asynchronous version of SafeInvoke
    • Uses BeginInvoke for non-blocking calls
  • AsyncSafeInvoke(params object[] arguments) - Async MulticastDelegate version
    • Includes retry logic (30 attempts) for dispatcher failures

Custom Types

ObservableList<T>

Thread-safe observable list with WPF dispatcher integration

  • Implements IList<T>, IList, INotifyCollectionChanged
  • Requires T : INotifyPropertyChanged
  • Constructor: ObservableList(Dispatcher dispatcher = null)
  • All mutations automatically invoke on dispatcher thread
  • Supports locking for thread-safe operations

ObservableDictionary<TKey, TValue>

Thread-safe observable dictionary with WPF dispatcher integration

  • Implements IDictionary<TKey, TValue>, INotifyCollectionChanged, INotifyPropertyChanged
  • Constructors:
    • ObservableDictionary(Dispatcher dispatcher = null)
    • ObservableDictionary(IDictionary<TKey, TValue> dictionary)
    • ObservableDictionary(int capacity)
  • All mutations automatically invoke on dispatcher thread
  • Automatically handles property change notifications for values implementing INotifyPropertyChanged

Installation

dotnet add package FrameworkExtensions.PresentationCore

License

LGPL 3.0 or later - See LICENSE for details

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net6.0-windows7.0 is compatible.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
.NET Core netcoreapp3.1 is compatible. 
.NET Framework net40 is compatible.  net403 was computed.  net45 is compatible.  net451 was computed.  net452 was computed.  net46 was computed.  net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 is compatible.  net481 was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.0.37 114 3/2/2026
1.0.0.35 283 12/15/2025
1.0.0.34 364 11/17/2025
1.0.0.33 946 7/7/2025
1.0.0.32 1,354 6/24/2024
1.0.0.31 244 6/17/2024
1.0.0.29 273 6/10/2024
1.0.0.28 220 5/27/2024
1.0.0.27 291 5/6/2024
1.0.0.25 210 4/29/2024
1.0.0.23 375 3/5/2024
1.0.0.22 877 7/23/2023
1.0.0.21 255 7/21/2023
1.0.0.20 249 7/19/2023
1.0.0.19 241 7/19/2023
1.0.0.17 270 7/19/2023