3
votes

I have a problem with defining actions using Caliburn.Micro in my xaml file (Windows Phone Silverlight 8.1).

namespaces:

xmlns:cal="clr-namespace:Caliburn.Micro;assembly=Caliburn.Micro"
xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"

Method 1.

<Button Content="TEST" FontSize="30" HorizontalAlignment="Center" VerticalAlignment="Center" >
                <i:Interaction.Triggers>
                    <i:EventTrigger EventName="Click">
                        <cal:ActionMessage MethodName="test" />
                    </i:EventTrigger>
                </i:Interaction.Triggers>
</Button>

Method 2.

<Button Content="TEST" FontSize="30" HorizontalAlignment="Center" VerticalAlignment="Center" cal:Message.Attach="[Event Click] = [Action test]"/>

Both methods give me errors:

  • Error 1 The attachable property 'Attach' was not found in type 'Message'.
  • Error 2 The name "Message" does not exist in the namespace
    "clr-namespace:Caliburn.Micro;assembly=Caliburn.Micro".
  • Error 3 The property 'Attach' does not exist on the type 'Button' in the XML namespace 'clr-namespace:Caliburn.Micro;assembly=Caliburn.Micro'.

Any suggestions?

Thanks in advance. Damian

1
can you show us some bootstrapper code w/respect to Configure and viewmodel code w/respect to how you coded up your Test method?mvermef

1 Answers

8
votes

Try use xmlns:cal="clr-namespace:Caliburn.Micro;assembly=Caliburn.Micro.Platform" you are probably using the latest Csliburn.Micro version. Read about it on http://wp.qmatteoq.com/porting-a-windows-phone-8-0-application-to-caliburn-micro-2-0-2/