How can I attach two attached behaviors to one XAML element?

后端 未结 2 820
自闭症患者
自闭症患者 2021-01-07 17:00

I\'ve implemented the attached command behavior pattern found here and it works well to allow e.g. a Border to have a left- or right-click event that fires

2条回答
  •  醉话见心
    2021-01-07 17:54

    "that was it, thanks, funny though that my XAML editor gives me the error "The attachable property 'Behaviors' was not found in type 'CommandBehaviorCollection'." although I can run and compile it fine, why is that?"

    The reason is that the code that allows the command behavior collection (which is an attached property collection) is actualy sort of a XAML loophole. You can read more about that here: http://wekempf.spaces.live.com/blog/cns!D18C3EC06EA971CF!468.entry?sa=276442122

提交回复
热议问题