I can't reproduce your problem. You could try to refer to the example below.
MainWindow.xaml:
<Window.DataContext>
<local:ViewModel />
</Window.DataContext>
<Window.Resources>
<DataTemplate x:Key="ComboBoxItemTemplate" >
<Grid Width="{Binding ElementName=cb,Path=Width }">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="8*"/>
<ColumnDefinition Width="2*"/>
</Grid.ColumnDefinitions>
<TextBlock x:Name="EntityName" Text="{Binding Name}" />
<Image Visibility="{Binding ISShow}" Grid.Column="1" Source="delete.png" HorizontalAlignment="Center" >
<Image.InputBindings>
<MouseBinding Gesture="LeftClick"
Command="{Binding DataContext.MyCommand,
RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}}}"
CommandParameter="{Binding}"/>
</Image.InputBindings>
</Image>
</Grid>
</DataTemplate>
</Window.Resources>
<Grid>
<ComboBox Name="cb" ItemsSource="{Binding Path=Books}" Width="200" Height="40"
ItemTemplate="{StaticResource ComboBoxItemTemplate}"
SelectedValue="{Binding SelectedItem ,Mode=TwoWay}" >
</ComboBox>
</Grid>
MainWindow.xaml.cs:
The result:
If the response is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our [documentation][5] to enable e-mail notifications if you want to receive the related email notification for this thread.
[5]: https://learn.microsoft.com/en-us/answers/articles/67444/email-notifications.html