Files
MSEssentials.UI.Common.MVVM/SimpleToolkit.MVVM/ObservableKeyValuePair.cs
Mateusz Skoczek 28ff189450
All checks were successful
Build and publish package / Build (push) Successful in 17s
Build and publish package / Determine version (push) Successful in 16s
Build and publish package / Pack (push) Successful in 23s
Build and publish package / Publish (push) Successful in 13s
migration
2026-02-15 16:20:10 +01:00

76 lines
1.4 KiB
C#

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SimpleToolkit.MVVM
{
public class ObservableKeyValuePair<TKey, TValue> : INotifyPropertyChanged
{
#region FIELDS
private TKey _key;
private TValue _value;
#endregion
#region PROPERTIES
public TKey Key
{
get => _key;
set
{
_key = value;
NotifyPropertyChanged(nameof(Key));
}
}
public TValue Value
{
get => _value;
set
{
_value = value;
NotifyPropertyChanged(nameof(Value));
}
}
#endregion
#region CONSTRUCTORS
public ObservableKeyValuePair() : this(default, default)
{ }
public ObservableKeyValuePair(TKey key, TValue value)
{
_key = key;
_value = value;
}
#endregion
#region PRIVATE METHODS
private void NotifyPropertyChanged(string name) => PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(name));
#endregion
#region EVENTS
public event PropertyChangedEventHandler? PropertyChanged;
#endregion
}
}