SkipSearchingForInfoBarMessageControl not working in behavior

Topics: Issues / bugs
Jul 18, 2012 at 5:17 PM

I have a UserControl using the UserControlBehavior to create the Catel Logic.  I have the behavior declared in the UserControl's XAML file like this:

        <catel:UserControlBehavior x:Name="mvvmBehavior"

However, when I run my app, I get an error in UserControlBehavior.SkipSearchingForInfoBarMessageControl.Setter, because the Logic object has not been created yet.  The Logic is not created until OnAttached() gets called.

Is this a bug, or am I missing something?

Also, I noticed that BehaviorBase.OnAttached and .OnDetaching both have remarks that say you can override them in derived classes, but both methods are marked sealed.  I think these remarks should be moved to the Initialize and Uninitialize methods.  


Jul 19, 2012 at 7:30 AM

This is still on the todo list. Internally, it directly sets the Logic properties, but the logic is created when the item is attached, so after the properties are set. We must implement some sort of temporary property bag for this, but this has a low priority.

Best is to create your own user control with a logic as described here

You are right about the docs, fixed it.