locked
Blend 3 not reacting to [Category("X")] on Behavior RRS feed

  • Question

  • Hello!

    I'm just getting started on behavior development and wondered why Blend3 does not put my Behaviors into the category I define. The code looks like the following:

    namespace MyLibrary
    {

        [Category("TestBehaviors"), Description("Test")]
        public class SystemControllerBehavior : Behavior<FrameworkElement>
        {
          
            private double testval;

            [Category("Test")]
            [Description("Whatever")]
            public double Testval
            {
                get { return testval; }
                set
                {
                    testval = value;
                }
            }
        }
    }

    The public property Testval is correctly put into the "Test" category when I click on the attached behavior, but the behavior itself is just pust into the standard behavior collection. I simply do not understand why.
    Something I have also observed: as I tried the Farseer PhysicsHelper Library I saw that it's behaviors are put into a "Physics" category. Then I tried renaming just the category names from "Physics" to "Test" and recompiled the library again - after this simple change the Behaviors are also not put into any category anymore. Do I need to set anything specific for the compiler?

    Thank you for any kind of help or hint!
    Cheers and best regards
    Martin
    Friday, October 9, 2009 11:42 AM

Answers

  • Hi Martin,

    The CategoryAttribute is used to categorize properties in the property inspector; in order to categorize types in the asset tool, you'll want to use the ToolboxCategoryAttribute from the Microsoft.Windows.Design namespace, defined in the Microsoft.Windows.Design.Interaction DLL.

    Jeff
    Friday, October 9, 2009 9:59 PM

All replies

  • Hi Martin,

    The CategoryAttribute is used to categorize properties in the property inspector; in order to categorize types in the asset tool, you'll want to use the ToolboxCategoryAttribute from the Microsoft.Windows.Design namespace, defined in the Microsoft.Windows.Design.Interaction DLL.

    Jeff
    Friday, October 9, 2009 9:59 PM
  • Hi Jeff,

    thanks a big lot, working now :)

    Best regards and cheers!
    Martin
    Monday, October 12, 2009 2:10 PM