This project is read-only.


xmlns:cal="" is not working in WP7/8


I'm setting up a Windows Phone 8 project and I've noticed that I can't use the short syntax to attach an action to a control, like for example:

<Button cal:Message.Attach="[EventName Click] = [Action ShowNameAction]" Content="Click" />

The cal namespace is defined like this:


When I launch the application, I get a XamlParseException complaining that no Attach property has been found for Message.

If I use the long syntax, instead, everything is working fine.
Closed Mar 10, 2013 at 3:01 AM by EisenbergEffect


tibel wrote Jan 19, 2013 at 9:08 PM

You can use xmlns:cal="clr-namespace:Caliburn.Micro;assembly=Caliburn.Micro" then the short syntax for cal:Message.Attach will work.

Seems that there is an issue with http namespace declarations in WP8.

qmatteoq wrote Jan 19, 2013 at 11:13 PM

Thanks for the feedback!
With your suggestion the exception is gone, but still doesn't work. I click on the button and nothing happen. The strange thing is that CanExecute method is evaluated successfully instead.
So, in the end, here is my code in XAML:

<Button cal:Message.Attach="[EventName Click] = [Action ShowName]" Content="Clicked" />

and this is my view model:
    public bool CanShowName
        get { return IsEnabled; }

    public void ShowName()
The CanShowName property is correctly evaluated, but when I click on the button the ShowName method is not invoked.

tibel wrote Jan 20, 2013 at 8:49 AM

When you change your button definition to use Event instead of EventName it will work:
<Button cal:Message.Attach="[Event Click] = [Action ShowName]" Content="Clicked" />

The other issue is with the http namespace:
Adding <AssemblyPart x:Name="Caliburn.Micro" Source="Caliburn.Micro.dll" /> to AppManifest.xml will prevent the exception on runtime. The XAML designer in VS2012 is still not able to display a preview and It occurs on WP71 projects too.

Is XmlnsDefinitionAttribute not supported on Windows Phone any more???

tibel wrote Jan 23, 2013 at 7:39 PM

I removed "" from WP7 and WP8 version of Caliburn.Micro.

EisenbergEffect wrote Feb 28, 2013 at 8:57 PM

** Closed by EisenbergEffect 02/28/2013 12:57PM