到目前为止,我已经在构造函数
中使用了一些Catel DataWindowpublic class MyViewModel: base(Catel.Windows.DataWindowMode.OkCancel, null, Catel.Windows.DataWindowDefaultButton.None, true, Catel.Windows.InfoBarMessageControlGenerationMode.None)
为了没有InfoBarMessage而且效果很好
现在我有一个catel:UserControl如何禁用InfoBarMessage?因为我有一个模型验证了一些过滤器,我想对UIElements进行验证
由于
答案 0 :(得分:0)
用户控件不会在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
----------------------------------------------------------------