共用方式為


AdornerLayout.IsAssociated 方法

取得值,表示指定的模型項目是否與這個裝飾項相關聯。

命名空間:  Microsoft.Windows.Design.Interaction
組件:  Microsoft.Windows.Design.Interaction (在 Microsoft.Windows.Design.Interaction.dll 中)

語法

'宣告
Public MustOverride Function IsAssociated ( _
    adorner As UIElement, _
    item As ModelItem _
) As Boolean
public abstract bool IsAssociated(
    UIElement adorner,
    ModelItem item
)
public:
virtual bool IsAssociated(
    UIElement^ adorner, 
    ModelItem^ item
) abstract
abstract IsAssociated : 
        adorner:UIElement * 
        item:ModelItem -> bool 
public abstract function IsAssociated(
    adorner : UIElement, 
    item : ModelItem
) : boolean

參數

傳回值

型別:System.Boolean
如果這個裝飾項與指定的模型項目有關聯,則為 true。

例外狀況

例外狀況 條件
ArgumentNullException

adorner 或 item 是 nullNull 參照 (即 Visual Basic 中的 Nothing)。

備註

從文件樹狀結構中移除模型項目時,DesignerView 會呼叫這個方法,檢查裝飾項是否正在使用這個項目。 如果是的話,DesignerView 就會移除這個裝飾項。

.NET Framework 安全性

請參閱

參考

AdornerLayout 類別

Microsoft.Windows.Design.Interaction 命名空間

AdornerPanel

PrimarySelectionAdornerProvider

其他資源

逐步解說:建立設計階段裝飾項

裝飾項架構