I have a DataGrid in my WPF application where every row ends with a Delete button.
<DataTemplate>
<Button
Command="Delete"
CommandParameter="{Binding}" FontWeight="Bold" Foreground="{x:Null}" IsEnabled="True" BorderBrush="{x:Null}">
<Button.Background>
<ImageBrush ImageSource="Ikonok/bin.png"/>
</Button.Background>
<Button.Style>
<Style TargetType="{x:Type Button}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type Button}">
<Border Background="{TemplateBinding Background}" BorderBrush="{x:Null}" BorderThickness="1">
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</Button.Style>
</Button> </DataTemplate>
How can I write a code behind that drops a MessageBox before the delete action that asks if the user really want to delete that item?