Closed SuperJMN closed 7 months ago
Well BehaviorCollection is using same mechanism as data templates, not sure if it's possible to make it work like that. There is some mechanism for setting multiple transforms using special type but not sure it will work in similar way for behaviours collection.
I think to make this work we would need some Xaml compiler support
If StyleA sets Behavior1 to MyControl AND AFTER THAT StyleB sets Behavior2 to MyControl
THEN StyleB will prevail and Behavior1 won't be attached.
This means that scenarios in which require several Behaviors to be applied by different Styles aren't possible.
This is my scenario: I have a Style that applies ShowSuggestionFlyoutBehavior to a TextBox that is part of another control (DecimalTextEntry), and DecimalTextEntry has a Style that sets a NumberBoxBehavior to the same TextBox.
This means that both styles (each one in a different level of abstraction) are in conflict. There should be a way to combine the behaviors from each
BehaviorCollection
.