24 lines
713 B
C#
24 lines
713 B
C#
|
|
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));
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|