How can I link a Button to a TreeView?
Hi everybody i'm new in this,i'm doing the designing a program(don't know barely nothing of coding), i need to link a button to a TreeView to appear,so when i click the button the treeview shows,when开发者_StackOverflow中文版 clicking other button,another treeview appears.
How can i do this?
Thanks
Im newbie!
Name the tree view controls with an x:Name attribute in the XAML. This will give you an instance which you can manipulate from code behind.
Subscribe to the click event of the button.
Set the Visibility property of the tree view to Visibility.Collapsed or Visibility.Visible in the click handler code.
精彩评论