[英]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();
}
EventCallback is a struct
which are, by design, non-nullable . EventCallback是一个
struct
, 根据设计,它是不可为空的。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.