Create AttachMessage failing in WinRT

Topics: Actions & Coroutines, Getting Started
Apr 20, 2013 at 12:12 AM
Hello,

I am trying to use Caliburn Micro with my WinRT project (VS 2012 update 2). I have an app bar with buttons. When I try to use following syntax with buttons-

xmlns:i="clr-namespace:Windows.UI.Interactivity;assembly=Windows.UI.Interactivity"

<i:Interaction.Triggers>
                            <i:EventTrigger EventName="Click">
                                <cal:ActionMessage MethodName="ShowSummary"/>
                            </i:EventTrigger>
                        </i:Interaction.Triggers>
I get error message saying-

"Unknown attachable member 'Interaction.Triggers' on element 'Button'
"Unknown type 'ActionMessage' in XML namespace 'clr-namespace:Caliburn.Micro;assembly=Caliburn.Micro '

I am using Caliburn Micro (4.0.30319) from nuget.

Please help!!!

apurv
Apr 21, 2013 at 2:26 AM
Does the shorthand syntax work for you?
<Button caliburn:Message.Attach="ShowSummary"/>
Apr 22, 2013 at 12:36 AM
Edited Apr 22, 2013 at 12:53 AM
No I get the following error message-

"Unknown attacheable member Message.Attach on element button"

Here is my complete xaml
<Page
    x:Class="Caliburn.FeatureLayer.Editing.Views.MapView"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:Caliburn.FeatureLayer.Editing.Views"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:esri="using:ESRI.ArcGIS.Runtime.Xaml"
    xmlns:sym="using:ESRI.ArcGIS.Runtime.Symbology"
    xmlns:common="using:Caliburn.FeatureLayer.Editing.Common"
    xmlns:cal="clr-namespace:Caliburn.Micro;assembly=Caliburn.Micro"
    xmlns:i="clr-namespace:Windows.UI.Interactivity;assembly=Windows.UI.Interactivity" 
    mc:Ignorable="d">
    <Page.BottomAppBar>
        <AppBar x:Name="BottomAppBar1" Padding="10,0,10,0" AutomationProperties.Name="Bottom App Bar">
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="50*"/>
                    <ColumnDefinition Width="50*"/>
                </Grid.ColumnDefinitions>
                <StackPanel x:Name="LeftPanel" Orientation="Horizontal" Grid.Column="0" HorizontalAlignment="Left">
                    <Button x:Name="AddFeatureLayer" Style="{StaticResource EditAppBarButtonStyle}"/>
                    <Button Style="{StaticResource SaveAppBarButtonStyle}" />
                    <Button x:Name="Delete"  Style="{StaticResource DeleteAppBarButtonStyle}" Tag="Delete"/>
                </StackPanel>
                <StackPanel x:Name="RightPanel" Orientation="Horizontal" Grid.Column="1" HorizontalAlignment="Right">
                    <Button x:Name="Refresh" Tag="Refresh"/>
                    <Button x:Name="Previous" Tag="Previous"/>
                    <Button x:Name="Next" Tag="Next"/>
                    <Button x:Name="Help" Tag="Help"/>
                </StackPanel>
            </Grid>
        </AppBar>
    </Page.BottomAppBar>
    <Grid Background="{StaticResource ApplicationPageBackgroundThemeBrush}">
        <esri:Map x:Name="MyMap" WrapAround="True" Layers="{Binding Layers}" />

    </Grid>
</Page>
Apr 22, 2013 at 12:50 AM
If possible could you send me a sample of this failing as I can't recreate it.

nigel.sampson AT compiledexperience.com
Apr 22, 2013 at 5:26 PM
Thanks Nigel! I finally figured it out-

the syntax to use namespace in xaml is this-

xmlns:cal="using:Caliburn.Micro"

I was using this syntax which gave me error-

xmlns:cal="clr-namespace:Caliburn.Micro;assembly=Caliburn.Micro"