代码之家  ›  专栏  ›  技术社区  ›  A1exandr Belan

如何在非杂项面板中放置依赖项属性?

  •  1
  • A1exandr Belan  · 技术社区  · 16 年前

    当我向用户控件添加依赖项属性时,我总是在属性窗口的杂项面板(在Expression Blend中)中找到它。 但是,有时我有太多的自定义属性,它们都在杂项面板中。 如何将属性放入其他面板?也许我可以做我自己的面板?但是我不知道怎么做。

    2 回复  |  直到 16 年前
        1
  •  2
  •   Reed Copsey    16 年前

    中的属性 System.ComponentModel 确定这一点。

    在您的情况下,您需要指定 [Category] 用于您的财产。

        2
  •  1
  •   DavidA    16 年前

    我还想用这样的描述来装饰该方法:

        [Category("Modal Options")]
        [Description("Set the modal background on or off")]
        public bool Modal
        {
            get { return (bool)GetValue(ModalProperty); }
            set { SetValue(ModalProperty, value); toggleModal(); }
        }