InfoBarMessageControl

Topics: Issues / bugs
Dec 18, 2012 at 4:20 PM
Edited Dec 18, 2012 at 4:20 PM

Other question to the InfoBarMessageControl. According to my problem with the "Slow startup of app" and the "SkipSearchingForInfoBarMessageControl". I wan't to test the InfoBarMessageControl.

So in my MainView I add

<catel:InfoBarMessageControl ></catel:InfoBarMessageControl>

But I don't see anything

How do I use this control? What Propertys do I have to set?

Coordinator
Dec 18, 2012 at 5:05 PM

You have to add a warning and error validator:

http://catel.catenalogic.com/index.html?validation.htm

Dec 19, 2012 at 8:48 AM

Hm. Now I added a

<catel:WarningAndErrorValidator Source="{Binding MyObject}" />

But what's MyObject. I don't know what to bind.

I don't see any thing in my view.

Can you give an Example. Sorry.


Coordinator
Dec 19, 2012 at 9:07 AM

My object is your business object implementing one of the validation interfaces (IDataErrorInfo, INotifyDataErrorInfo). Thus, your view model {Binding}, or your model {Binding MyModel}.

Dec 19, 2012 at 9:40 AM
Edited Dec 19, 2012 at 9:41 AM

Ok now my code looks like this

 <catel:InfoBarMessageControl>
<DockPanel>
<catel:WarningAndErrorValidator Source="{Binding}" />
...

</
DockPanel>
</
catel:InfoBarMessageControl>

 

Because the Datacontext of the usercontrol is a viewmodel.

But also I don't see anything.


Coordinator
Dec 19, 2012 at 9:41 AM

Does your vm has errors or warnings? Did you override ValidateBusinessRules or ValidateFields?

Dec 19, 2012 at 9:49 AM
Edited Dec 19, 2012 at 9:52 AM

My vm has errors and I have override ValidateFields but not directly in the viemodel but in the child vm's.

Coordinator
Dec 19, 2012 at 9:58 AM

Please, test basic functionality first before you start doing advanced scenarios. Make sure you *understand* what is going on, then expand your use cases. There are enough examples in the Examples Repository that show how to handle validation.

Dec 19, 2012 at 10:51 AM
Edited Dec 20, 2012 at 2:29 PM

Ok, Thanks for the answer.

Now I have a validationrule error in the vm and I see the InfoBarMessageControl. But only when I first click in the Textbox where the error occurs, add text, lostfocus, set focus again, delete the text and lost focus again. So not on startup when the textbox ist empty.

1. Sometimes I think thats ok, but sometimes I want to see the error at startup. Is this possible? (That was the problem I dont see errors from the childs)

2. I have some validation rules in child. Some are errors, some are warnings. Thats ok. But I have also "infos". For example: I have an button activate. I can only activate when there are no errors. Additional when the current settings are activated I can not activate again. So my validationrules says current settings activated. So thats only for disable the button but don't show that as a error or warning in the Infomessagecontrol.

 

And something to say to the german message in the messagecontrol:

There is a missspelling:

"Es wurden folgende Fehler/Warnungen gefunden ( bewegen Sie den Mauszeiger auf einen Meldung um diese anzuzeigen)"

Correct: "eine Meldung"

Edit: I think the whole message is wrong. In the english message you write "hover to view". In german you write, translated to english :-) : Hover the single messages to view them.

Maybe better:

"Es sind Fehler/Warnungen vorhanden (Zeiger hier her bewegen um diese anzuzeigen)"

Dec 21, 2012 at 8:46 AM

I' m a little bit confused about the InfoBarMessageControl.

1. I add a error in ValidateBusinessRules() in the Viewmodel. With no condition just for test. But the InfobarMessageControl is not displayed.

When I add a condition ValidateBusinessRules for example any Property is != null. I see the error InfobarMessageControl. ???

2. I add a error in the Childviewmodel, with condition. The condition is true. The error is added. But on startup the InfoBarMessageControl is not displayed. I change something, so the condition is false, then back to true. Then the InfoBarMessageControl ist displayed. ???

3. When I look in to the examples Catel.Examples.WPF.Validaition I dont't find anywhere the InfoBarMessageControl nor the WarningAndErrorValidator. 

 

Coordinator
Dec 30, 2012 at 1:52 PM

If you have validation issues, please provide an reproducible example so I can get to the issue fast and easy.

1) Is the SuspendValidationUntilFirstSave set to true? You might want to disable this.

2) Same as 1

3) The InfoBarMessageControl and WarningAndErrorValidator are automatically added to the catel UserControl and DataWindow. So, we don't have to explicitly add them. Even when using the logic as behavior (where you use your own custom window), the behavior takes care of adding the validation controls.

Jan 7, 2013 at 8:53 AM
Edited Jan 7, 2013 at 8:54 AM

I set DeferValidationUntilFirstSaveCall = false; Dosn't matter

I load an configuration on startaup. The configuration has validation errors. Don't see them in the InfoBarMessageControl.

I see the errors only after I have changed the the Content of the control.

Example combobox:

wrong content: "mouse"
correct content: "cat"

 

start with content "mouse" -> no validation error. Change to "cat" and back to "mouse" -> validation error
start with content "cat" change to "mouse" -> validation error.

No save call only change the values.

So no validation error without any change of the control.

Jan 8, 2013 at 2:10 PM
Edited Jan 8, 2013 at 2:55 PM

Ok. I try to make a repro.

Edit: Repro Created :-)

-> http://catel.codeplex.com/workitem/7235