Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <TreeView Name="CategoryName" ItemsSource="{Binding Source={StaticResource A_Collection}, Path=RootItems}" />
- <TextBox Text="{Binding ElementName=CategoryTreeView, Path=SelectedValue.Name}"/>
- <ListView Name="listView1"
- ItemsSource="{Binding Path=SelectedItem.Modules,
- ElementName=treeView1, Mode=OneWay}"
- IsSynchronizedWithCurrentItem="True">
- // the XAML
- <TreeView DockPanel.Dock="Left" x:Name="tvwNodes" ItemsSource="{Binding}" SelectedItemChanged="OnNewNodeSelected"/>
- <ListView x:Name="lvwProperties" ItemsSource="{Binding Path=Properties}"
- // the code-behind
- private void OnNewNodeSelected(object sender, RoutedPropertyChangedEventArgs<object> e)
- {
- lvwProperties.DataContext = tvwNodes.SelectedItem; // this returns the selected Node obj
- }
Add Comment
Please, Sign In to add comment