Articles in this section
Category / Section

How to programmatically Show/Hide Annotations

1 min read

We have a support to customize the Visibility of Annotation. This can be achieved by using custom class from AnnotationEditorViewModel and ViewTemplate property of Annotation. We have provided code example, sample and screenshots to represent this.

Please refer to the code example, sample and screenshots as below.

C#

//Annotation collection
           node.Annotations = new ObservableCollection<AnnotationEditorViewModel>
           {
                new Annotation()
                {
                 Content="node",
                 //set visibility as Visible|Collapsed to Annotation content
                 Visibility=Visibility.Collapsed,
                 ViewTemplate=this.Resources["viewtemplate"] as DataTemplate
                }
           }; 
Here, node is instance of Node.

 

Sample Link:

https://www.syncfusion.com/downloads/support/directtrac/154014/ze/UWP-11691932196859

 

 

 

 

 

 

 

 

 

 

 

 

 

Screenshots:

Annotation is Visible

Annotation is Hidden

 

 

 

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Please sign in to leave a comment
Access denied
Access denied