6

私がそのように定義された添付プロパティを持っていると仮定します:

    public static string GetMyProperty(DependencyObject obj)
    {
        return (string)obj.GetValue(MyPropertyProperty);
    }

    public static void SetMyProperty(DependencyObject obj, string value)
    {
        obj.SetValue(MyPropertyProperty, value);
    }

    // Using a DependencyProperty as the backing store for MyProperty.  This enables animation, styling, binding, etc...
    public static readonly DependencyProperty MyPropertyProperty =
        DependencyProperty.RegisterAttached("MyProperty", typeof(string), typeof(MyClass), new UIPropertyMetadata(0));

プロパティ識別子(MyPropertyProperty)とアクセサ(GetMyPropertyと)のドキュメントを書くことはできますが、実際のコード要素ではないため、MyClass.MyProperty添付プロパティSetMyPropertyのドキュメントをどこに置くかわかりません。

MSDNライブラリにはそのようなドキュメントが含まれているため(たとえばを参照Grid.Row)、それが可能である必要があります...

添付プロパティのXMLドキュメントコメントはどこに配置すればよいですか?

4

2 に答える 2

3

サンドキャッスルについての記事があります:

/// <summary>
/// This defines the <see cref="P:TestDoc.TestClass.IsBroughtIntoViewWhenSelected"/>
/// attached property.
/// </summary>
///
/// <AttachedPropertyComments>
/// <summary>This attached property indicates whether or not a tree view item is
/// brought into view when selected.
/// </summary>
/// <value>The default value is false</value>
/// </AttachedPropertyComments>
public static readonly DependencyProperty IsBroughtIntoViewWhenSelectedProperty =
    DependencyProperty.RegisterAttached("IsBroughtIntoViewWhenSelected",
typeof(bool), typeof(TestClass),
new UIPropertyMetadata(false, OnIsBroughtIntoViewWhenSelectedChanged));
于 2009-08-03T20:37:28.380 に答える
1

答えは少し遅れていますが、VisualStudioの実行中にドキュメントが表示される解決策を見つけました。

ReSharperを使用してを押すと、 -methodCTRLQの上に追加されたXML-Documentationが。の表示に使用されます。SetXXXQuick-Documentation

于 2016-02-23T08:44:12.627 に答える