I have tried to hide/show an adorner of a specific element:
1) by trying to hide the adorned element, but with no success.
2) by using the following code, but when i apply it to the specific element, all other adorners are hidden (the elements are placed on different canvases).
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
How can i hide the adorner of a specific element?
You shouldnt be hiding the adornerlayer, instead you should just remove the adorner from the adorner layer and it will disappear.
For example you have an adorner as below
sorry i used c# syntax I am sure you can convert that to vb. Let me know if there is any problem