Files
SteamTools/System.Application.SteamTools.Client.Desktop/Mvvm/EventArgsFactory.cs
T
2021-02-26 19:00:49 +08:00

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));
}
}
}