Hi Member,
Have a look at this to get the idea:
<Window
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:WpfApplication2"
xmlns:System="clr-namespace:System;assembly=mscorlib"
x:Class="WpfApplication2.MainWindow"
mc:Ignorable="d"
Title="MainWindow"
Height="350"
Width="525">
<Window.Resources>
<BooleanToVisibilityConverter
x:Key="BooleanToVisibilityConverter">
</BooleanToVisibilityConverter>
</Window.Resources>
<Grid>
<TreeView>
<TreeView.ItemTemplate>
<DataTemplate>
<StackPanel
Orientation="Horizontal">
<TextBlock
Text="{Binding}" />
<Button
Content="clickme"
Visibility="{Binding Path=IsSelected, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type TreeViewItem}}, Converter={StaticResource BooleanToVisibilityConverter}}">
</Button>
</StackPanel>
</DataTemplate>
</TreeView.ItemTemplate>
<TreeViewItem></TreeViewItem>
<System:String>bla</System:String>
<System:String>bla</System:String>
<System:String>bla</System:String>
<System:String>bla</System:String>
<System:String>bla</System:String>
</TreeView>
</Grid>
</Window>