Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <ListBox DataContext="{StaticResource customers}"
- ItemsSource="{Binding}">
- ItemsSource="{Binding Path=TheImages, Source={StaticResource ImageFactoryDS}}"
- <StackPanel DataContext="{StaticResource Data}">
- <ListBox ItemsSource="{Binding Customers}"/>
- <ListBox ItemsSource="{Binding Orders}"/>
- </StackPanel>
- <ListBox ItemsSource="{Binding Source={StaticResource customers}}"/>
- Class Root
- {
- public string Name;
- public List<ChildRoot> childRoots = new List<ChildRoot>();
- }
- Class ChildRoot
- {
- public string childName;
- }
- Root r = new Root()
- r.Name = "ROOT1";
- ChildRoot c1 = new ChildRoot()
- c1.childName = "Child1";
- r.childRoots.Add(c1);
- c1 = new ChildRoot()
- c1.childName = "Child2";
- r.childRoots.Add(c1);
- c1 = new ChildRoot()
- c1.childName = "Child3";
- r.childRoots.Add(c1);
- treeView.DataContext = r;
- <TreeViewItem ItemsSource="{Binding Path=childRoots}" Header="{Binding Path=Name}">
- <HierarchicalDataTemplate DataType="{x:Type local:Root}" ItemsSource="{Binding Path=childRoots}">
- List<Root> lstRoots = new List<Root>();
- lstRoots.Add(r);
- <HierarchicalDataTemplate DataType="{x:Type local:Root}" ItemsSource="{Binding Path=childRoots}">
Add Comment
Please, Sign In to add comment