2
我已經找到了這個無處不在,我已經下載DLL
爲LINQ Data
並且也有在參考中添加System.Reflection
,但它仍然無法找到它。哪裏可以找到GetMemberInfo
C#代碼:
protected void NotifyOfPropertyChanged(string name)
{
PropertyChangedEventHandler handler = PropertyChanged;
if (handler != null)
{
handler(this, new PropertyChangedEventArgs(name));
}
}
protected void NotifyOfPropertyChanged<TProperty>(Expression<Func<TProperty>> property)
{
NotifyOfPropertyChanged(property.GetMemberInfo().Name);
}
在此行中出現的錯誤:
NotifyOfPropertyChanged(property.GetMemberInfo().Name);
和錯誤讀取:
'System.Linq.Expressions.Expression<System.Func<TProperty>>' does not contain a definition for 'GetMemberInfo' and no extension method 'GetMemberInfo' accepting a first argument of type 'System.Linq.Expressions.Expression<System.Func<TProperty>>' could be found (are you missing a using directive or an assembly reference?
@ScottChamberlain你怎麼把任何東西那裏不是'LambdaExpression'?我的意思是,這個方法怎麼能用於其他任何東西? –
@HighCore這仍然不起作用。 – user3157821
@ user3157821 *「這不起作用」*確實含糊不清。你能澄清一下嗎?你有例外嗎?如果是這樣,那是什麼?它在我的框架中工作。 –