简体   繁体   English

如果 Changed 是 EventCallback 类型,为什么我们不能使用? 在 Changed?.InvokeAsync()?

[英]If Changed is of type EventCallback, why can't we use ?. in Changed?.InvokeAsync()?

I wonder why I cannot use ?.我想知道为什么我不能使用?. (null conditional operator) in the following. (空条件运算符)在下面。

[Parameter] public EventCallback Changed {get; set;}
private void OnChanged()
{
  Changed?.InvokeAsync();
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如果匿名类型应该是不可变的,为什么可以更改它? - Why can the anonymous type be changed if it is supposed to be immutable? 为什么有些 Enumerable 可以在 foreach 中更改,而有些则不能? - Why can some Enumerable be changed inside foreach, and others can't? DataContractSerializer:由于属性类型更改而无法反序列化 - DataContractSerializer: can't deserialize because of changed property type 从 .Hide() 更改为 .Show() 的表单无法最大化,为什么? - A form that was changed from .Hide() to .Show() can't maximize,why? 为什么EventCallback类型的事件可以<datetime>分配 void Foo(DateTime dt) 或 void Foo()?</datetime> - Why can an event of type EventCallback<DateTime> be assigned either void Foo(DateTime dt) or void Foo()? 为什么我们不能锁定值类型? - Why can't we lock on a value type? 下载时文件类型更改的原因是什么? - why the file type is changed when downloaded? 为什么我的标签不会更改 - Why won't my labels stay changed 为什么标签文本没有立即更改? - Why isn't the label text changed instantly? 为什么在使用XDocument的WriteTo方法时更改了XDocument编码类型 - Why XDocument encoding type changed while use XDocument's WriteTo method
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM