Source%20Generator/FieldAttributes/ #7
Replies: 3 comments 10 replies
-
通知中继指令更新其可用状态中: [ObservableProperty]
[NotifyCanExecuteChangedFor(nameof(FooCommand))]
private bool isFooEnabled; 如果是在线程中对FooEnabled进行赋值,会报错,这个有什么解决方案么? Task.Run(()=>{ FooEnabled = true;}); 会报错 |
Beta Was this translation helpful? Give feedback.
-
被[ObservableProperty]标记的字段怎么在get或者set中里添加方法 |
Beta Was this translation helpful? Give feedback.
-
我的属性希望是可为空的就像这样: [ObservableProperty]
private string passWord; 对应的前台控件是这样的 <ui:PasswordBox MinWidth="200" Password="{Binding PassWord, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" /> 但是我绑定的控件却在初始化时产生了空引用异常,这个控件是WPF UI的PassWord控件,我这里希望通过修改生成属性的get方法让其判断获取到null时返回一个空字符串可以么,又或者更改绑定模式能否解决这个问题 |
Beta Was this translation helpful? Give feedback.
-
Source%20Generator/FieldAttributes/
https://mvvm.coldwind.top/Source%20Generator/FieldAttributes/
Beta Was this translation helpful? Give feedback.
All reactions