init
This commit is contained in:
23
Common/DTS.Common/Base/Classes/BaseUserControl.cs
Normal file
23
Common/DTS.Common/Base/Classes/BaseUserControl.cs
Normal file
@@ -0,0 +1,23 @@
|
||||
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));
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user