32

I am working on a Windows Phone 8 project with Caliburn.Micro and I want to attach to 2 separate events on the same button.

What is the syntax for doing this?

I have tried a few combinations of the below but keep getting an error from Caliburn saying "Hop pair not part of existing route"

cm:Message.Attach="[Event Tap] = [Action SelectItem], [Event Hold] = [Action OpenItemMenu]"

So far I have been able to get it working with 1 event using the short syntax and one using the long but would prefer to be able to use them both the same way.

dkarzon
  • 7,513
  • 9
  • 46
  • 61
  • Just in case - in Windows Phone 8.1 the event name is [Holding](https://msdn.microsoft.com/en-us/library/windows/apps/xaml/windows.ui.xaml.uielement.holding), not _Hold_. _Hold_ is name of interaction gesture. – Sevenate Mar 11 '15 at 17:23

1 Answers1

62

The delimiter for specifying multiple actions is a semicolon ;

<Button Content="Let's Talk" cal:Message.Attach="[Event MouseEnter] = [Action Talk('Hello', Name.Text)]; [Event  MouseLeave] = [Action Talk('Goodbye', Name.Text)]" />
boop
  • 6,033
  • 9
  • 37
  • 76
Nigel Sampson
  • 10,179
  • 1
  • 26
  • 31