Files
DP44/Common/DTS.Common/Base/Classes/BaseUserControl.cs

24 lines
713 B
C#
Raw Normal View History

2026-04-17 14:55:32 -04:00
using System;
using System.ComponentModel;
using System.Windows.Controls;
namespace DTS.Common.Base.Classes
{
public abstract class BaseUserControl : UserControl
{
public event PropertyChangedEventHandler PropertyChanged;
protected bool SetProperty<T>(ref T storage, T value, String propertyName = null)
{
if (Equals(storage, value)) return false;
storage = value;
OnPropertyChanged(propertyName);
return true;
}
protected void OnPropertyChanged(string propertyName = null)
{
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
}
}
}