gpt4 book ai didi

c# - 有没有办法避免在 Xamarin 中每个方法的 setter 中调用 NotifyChanged?

转载 作者:太空宇宙 更新时间:2023-11-03 20:58:11 25 4
gpt4 key购买 nike

<分区>

这个问题说明了一切。使用 Xamarin 时会出现这种模式:

public string Property
{
get
{
return this.propertyField;
}

set
{
if (value != this.propertyField)
{
this.propertyField = value;
NotifyPropertyChanged();
}
}
}

似乎我必须为我拥有的每个属性执行此操作。有什么办法避免重复?

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com