PRISM - Creating mouseoverbehavior causes a Silverlight library to not be visible in main Silverligh

Posted by RHLopez on Stack Overflow See other posts from Stack Overflow or by RHLopez
Published on 2010-05-07T18:18:39Z Indexed on 2010/05/09 13:28 UTC
Read the original article Hit count: 399

Created a simple Silverlight 4 application (SimpleApp) then added a Silverlight 4 library (LibraryA). Added code to the library (LibraryA) to implement MouseOverBehavior by inheriting from CommandBaseBehavior along with the appropriate attached property class/methods. Added reference in SimpleApp to LibraryA and went to MainPage.xaml to add namespace reference but it does not show up with Intellisense. Typing the namespace manually and then adding the attached MouseOver command works as it should as far as intellisense showing my attached property name, i.e. ... commands:MouseOver.Command="{Binding MousedOver}". However when I try to run it I get a XAML parser error saying that the "Command" attached property does not exist in MouseOver. If I move my class definitions from LibraryA to SimpleApp then everything works.

I removed everything from LibraryA and just put one class with this in it:

public class MouseOverBehavior : CommandBehaviorBase<Control>
{
    public MouseOverBehavior(Control element)
        : base(element)
    {}
}

With this simple class in LibraryA it will not show up in XAML intellisense in SimpleApp. XAML intellisense works with other libraries that I have written that don't use PRISM.

Don't know what I am missing hopefully it's something simple. I am using the latest SL4 build for PRISM change set 42969. Visual Studio 2010 RTM Professional in Windows 7 Ultimate 64-bit.

© Stack Overflow or respective owner

Related posts about silverlight-4.0

Related posts about prism