Adorner.Enabled 속성

정의

Adorner가 활성화되었는지 여부를 나타내는 값을 가져오거나 설정합니다.

public:
 property bool Enabled { bool get(); void set(bool value); };
public bool Enabled { get; set; }
member this.Enabled : bool with get, set
Public Property Enabled As Boolean

속성 값

Boolean

Adorner을 사용할 수 있으면 true이고, 그렇지 않으면 false입니다.

예제

다음 코드 예제에서는 사용 하 고 사용 하지 않도록 설정 Adorner하는 방법을 보여 줍니다. 전체 코드 목록은 방법: 디자인 모드에서 컨트롤의 모양 및 동작 확장을 참조하세요.

// The AnchorGlyph objects should mimic the resize glyphs;
// they should only be visible when the control is the 
// primary selection. The adorner is enabled when the 
// control is the primary selection and disabled when 
// it is not.

void selectionService_SelectionChanged(object sender, EventArgs e)
{
    if (object.ReferenceEquals(
        this.selectionService.PrimarySelection,
        this.relatedControl))
    {
        this.ComputeBounds();
        this.anchorAdorner.Enabled = true;
    }
    else
    {
        this.anchorAdorner.Enabled = false;
    }
}
' The AnchorGlyph objects should mimic the resize glyphs;
' they should only be visible when the control is the 
' primary selection. The adorner is enabled when the 
' control is the primary selection and disabled when 
' it is not.
Private Sub selectionService_SelectionChanged( _
ByVal sender As Object, _
ByVal e As EventArgs)

    If Object.ReferenceEquals( _
    Me.selectionService.PrimarySelection, _
    Me.relatedControl) Then
        Me.ComputeBounds()
        Me.anchorAdorner.Enabled = True
    Else
        Me.anchorAdorner.Enabled = False
    End If

End Sub

설명

속성이 Enabled true면 클래스가 BehaviorService 메시지를 보내고 메시지를 보냅니 HitTest Paint Adorner다.

적용 대상

추가 정보