在视图模型中将InfoBarMessage设置为none
本文关键字:设置 none InfoBarMessage 视图 模型 | 更新日期: 2023-09-27 17:57:27
到目前为止,我在构造函数中使用了一些Catel DataWindow指定
public class MyViewModel: base(Catel.Windows.DataWindowMode.OkCancel, null, Catel.Windows.DataWindowDefaultButton.None, true, Catel.Windows.InfoBarMessageControlGenerationMode.None)
为了没有InfoBarMessage,它可以完美地进行
现在我有了一个类别:UserControl,我如何禁用InfoBarMessage?因为我有一个验证一些过滤器的模型,我想对UIElements 进行验证
感谢
用户控件不会在Catel中创建InfoBarMessageControl。如果对所有窗口禁用它,则应设置UserControl.DefaultskipSearchingForInfoBarMessageControl = true;
。
你也应该看看ApiCop。它将根据您在运行时使用的实际代码告知您最佳实践,例如:
================================================================
DATAWINDOWTEST.VIEWS.AVIEW
================================================================
Cop TargetType: Catel.Windows.Controls.MVVMProviders.Logic.UserControlLogic
Rule: UserControlLogic.InfoBarMessageControl (Error)
For more information about this rule, visit https://catelproject.atlassian.net/wiki/display/CTL/Performance+considerations
[DataWindowTest.Views.AView] Feature used '0' of '2' times, consider turning it off by default
----------------------------------------------------------------
Cop TargetType: Catel.Windows.Controls.MVVMProviders.Logic.UserControlLogic
Rule: UserControlLogic.CreateWarningAndErrorValidator (Error)
For more information about this rule, visit https://catelproject.atlassian.net/wiki/display/CTL/Performance+considerations
[DataWindowTest.Views.AView] Feature used '0' of '2' times, consider turning it off by default
----------------------------------------------------------------