mirror of
https://github.com/BeyondDimension/SteamTools.git
synced 2026-10-22 01:16:17 +08:00
20 lines
704 B
C#
20 lines
704 B
C#
using System.Collections.Concurrent;
|
|
using System.ComponentModel;
|
|
using System.Diagnostics.CodeAnalysis;
|
|
|
|
namespace System.Application.Mvvm
|
|
{
|
|
internal static class EventArgsFactory
|
|
{
|
|
[NotNull]
|
|
private static readonly ConcurrentDictionary<string, PropertyChangedEventArgs>
|
|
PropertyChangedEventArgsDictionary = new ConcurrentDictionary<string, PropertyChangedEventArgs>();
|
|
|
|
public static PropertyChangedEventArgs GetPropertyChangedEventArgs([DisallowNull] string propertyName)
|
|
{
|
|
return PropertyChangedEventArgsDictionary.GetOrAdd(propertyName ?? string.Empty,
|
|
name => new PropertyChangedEventArgs(name));
|
|
}
|
|
}
|
|
}
|