【发布时间】:2021-06-29 22:11:45
【问题描述】:
我在一个类中创建了 INotifyPropertyChanged
public class BindableBase : INotifyPropertyChanged
{
public event PropertyChangedEventHandler PropertyChanged;
protected void Set<T>(ref T storage, T value, [CallerMemberName]string propertyName = null)
{
if (Equals(storage, value))
{
return;
}
storage = value;
RaisePropertyChanged(propertyName);
}
protected void RaisePropertyChanged([CallerMemberName]string propertyName = null)
{
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
}
}
现在当我尝试在用户控件中使用它时
public partial class myUserControl : UserControl, BindableBase
我遇到以下错误
myUserControl 不能有多个基类
【问题讨论】:
标签: c# wpf inotifypropertychanged