Search code examples
silverlightcaliburn

Caliburn bad parser error for container registered command


I have a silverlight 3 application with the latest Caliburn RTW.

I have a button with the following caliburn property in XAML: PresentationFramework:Message.Attach="ContainerCommand ClassesCommand()"/>

In my module.cs I have :

        _container.RegisterType(typeof(ClassesCommand), new ContainerControlledLifetimeManager());


        _regionManager.RegisterViewWithRegion("MenuRegion", () => _container.Resolve<ClassesButton>());

On the _container.Resolve() I get AG_E_PARSER_BAD_PROPERTY_VALUE for "ContainerCommand ClassesCommand()" in the XAML.

My ClassesCommand.cs is :

public class ClassesCommand
{

    public void Execute()
    {
        //
    }

    public bool CanExecute()
    {
        //
        return true;
    }

}

JD.


Solution

  • Try registering your command by Key instead of type. Also, try removing the empty parenthesis from the end. Let me know if either of these things fixes your issue. Thanks!