我试图隐藏/显示特定元素的装饰器:
1)试图隐藏装饰元素,但没有成功。
2)通过使用以下代码,但是当我将其应用于特定元素时,所有其他装饰器都被隐藏(元素放置在不同的画布上)。
Public Shared Sub ChangeAdornerLabelLineVisibility(ByRef line As Line, ByVal isAdornerVisible As Boolean)
Dim lineAdornerLayer As AdornerLayer
Try
lineAdornerLayer = AdornerLayer.GetAdornerLayer(line)
If isAdornerVisible Then
lineAdornerLayer.Visibility = Windows.Visibility.Visible
Else
lineAdornerLayer.Visibility = Windows.Visibility.Hidden
End If
Catch
End Try
End Sub
如何隐藏特定元素的装饰器?