using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Text;
using System.Threading.Tasks;
namespace Pelva
{
public abstract class BindableObject : INotifyPropertyChanged
{
public event PropertyChangedEventHandler PropertyChanged;
protected void OnPropertyChanged(string propertyName)
{
if (PropertyChanged != null)
{
try
{
PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
}
catch
{
}
}
}
protected void SetProperty<T>(ref T item, T value, [CallerMemberName] string propertyName = null)
{
if (!EqualityComparer<T>.Default.Equals(item, value))
{
item
WPF封装绑定类
最新推荐文章于 2023-06-22 08:00:00 发布