Skip to content

语言 / Languages

本页另有 English 和 日本語 版本。

源生成器 ​

MvvmAIO.Prism.SourceGenerators 在编译期扩展 partial 类型。特性定义在 MvvmAIO.Prism.Core 中(命名空间 Prism.SourceGenerators)。

partial 类型

凡生成成员要合并进你的声明处,类型须为 partial。PSG0001–PSG0005 覆盖常见错误;五项均提供 IDE MakePartial 代码修复。

主题 ​

主题摘要
ObservableProperty字段与 C# 13+ partial 属性目标、PropertyAccess、OnChanging / OnChanged。
通知与转发[NotifyPropertyChangedFor]、[NotifyCanExecuteChangedFor]、[property: …] 转发。
DelegateCommand同步命令、CanExecute、Task 执行方法、ValueTask。
AsyncDelegateCommand并行执行、Catch、CancelAfter、ObservesCanExecute、Prism 8 与 9 包差异。
ObservesProperty属性变化时重新求值 CanExecute。
BindableBase未继承 Prism BindableBase 时生成 INPC。
BindableValidator通过 [BindableValidator] 和 [NotifyDataErrorInfo] 生成 INotifyDataErrorInfo 验证支持。
容器注册Register*、RegisterForNavigation、RegisterDialog,生成 IContainerRegistry 调用。
NavigationAwareINavigationAware 生命周期;Prism 8 Prism.Regions / Prism 9 Prism.Navigation.Regions。
DialogAwareIDialogAware;Prism 8 Prism.Services.Dialogs / Prism 9 Prism.Dialogs。
NavigateCommandIRegionManager.RequestNavigate 命令生成(英文文档)。
ShowDialogCommandIDialogService.ShowDialog 命令生成(英文文档)。

诊断 ​

全部编译器 ID 见 诊断参考。

下一步 ​

基于 MIT 许可证发布。

基于 MIT 许可证发布。