InfoBarMessage set to none in viewmodel

190 views Asked by At

I've used so far some Catel DataWindow specifing in the constructor

public class MyViewModel: base(Catel.Windows.DataWindowMode.OkCancel, null, Catel.Windows.DataWindowDefaultButton.None, true, Catel.Windows.InfoBarMessageControlGenerationMode.None)

in order to not have the InfoBarMessage and it works perfectly

Now I've a catel:UserControl how can I disable that InfoBarMessage? since I've a Model that validates some filters and I want to have validation on UIElements

Thanks

1

There are 1 answers

1
Geert van Horrik On

User controls don't create an InfoBarMessageControl in Catel. If you disable it for all windows, you should set UserControl.DefaultskipSearchingForInfoBarMessageControl = true;.

You should also look into ApiCop. It will inform you about best practices based on the actual code you are using at runtime, for example:

================================================================
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

----------------------------------------------------------------