c# - Caliburn.Micro attach event handler on event of Behavior -
i wrote own behavior handle swipe gesture , put itemtemplate of listview. if swipe completed, raise event leftswipe or rightswipe. event should handled viewmodel. i use syntax of caliburn.micro attach handler event: cm:message.attach="[event leftswipe] = [leftswipe($source, $eventargs)" . this behavior: public class swipeinteractionbehavior : dependencyobject, ibehavior { public dependencyobject associatedobject { get; private set; } public void attach(dependencyobject associatedobject) { // ... } public void detach() { // ... } public event eventhandler leftswipe; public event eventhandler rightswipe; // ... // ... private void onleftswipe(frameworkelement element) { // ... if (leftswipe != null) { leftswipe(this, eventargs.empty); } } private void onrightswipe(frameworkelement element) { // ... if (rightswipe != null) ...