HI Mahesh thanks for the solution, every thing is working fine but it not working for the first item in the ListView. The first is not getting selected on clicking button.
How can I apply the same for a TabControl ?
<TabControl ItemsSource="{Binding CurrentlyShownCustomers}" SelectedItem="{Binding CurrentCustomer}" Grid.Column="1">
<TabControl.ItemTemplate>
<DataTemplate>
<ListView ItemsSource="{Binding CurrentlyShownCustomers}">
<StackPanel Orientation="Horizontal">
<TextBlock Text="{Binding FirstName}"/>
<Button Height="20" Width="20" Content="X" Grid.Column="1" Command="{Binding RelativeSource={RelativeSource FindAncestor,
AncestorType={x:Type TabControl}}, Path=DataContext.CloseTabItem}"/>
</StackPanel>
</ListView>
</DataTemplate>
</TabControl>