<TreeView BorderBrush="Black" BorderThickness="2" Cursor="Hand" ItemsSource="{Binding Data, UpdateSourceTrigger=PropertyChanged}" > <TreeView.ItemContainerStyle> <Style TargetType="{x:Type TreeViewItem}"> <Setter Property="IsSelected" Value="{Binding SelectedPath, Mode=TwoWay}" /> </Style> </TreeView.ItemContainerStyle> <TreeView.ItemTemplate> <HierarchicalDataTemplate ItemsSource="{ Binding Persons, UpdateSourceTrigger=PropertyChanged}" DataType="{x:Type local:Data}" > <Grid> <StackPanel Orientation="Horizontal"> <TextBlock x:Name="dane" Text="{Binding ID}" Margin="0,0,5,0" /> <Button Style="{StaticResource ButtonLikeTextBlock}" Content="{Binding DataOrName}" Command=" {Binding Path=DataContext.DisplayInfoCommand, RelativeSource = {RelativeSource FindAncestor, AncestorType={x:Type Window}}}" /> </StackPanel> </Grid> </HierarchicalDataTemplate> </TreeView.ItemTemplate> </TreeView>
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)