I've got a listbox of Labels, each bound to a LabelName and LabelColor. I want to add a small button that resembles an "X" and attach it on the right side of the Label. I want it to look seamless, like the X is very non-intrusive. Any ideas how to do this? The stuff between the <Label.ContentTemplate>
does NOT work. I don't even want it to looks like a clickable button, just an "X" that you can click on that fires off a button-click event.
<DataTemplate x:Key="LabelsListDataTemplate">
<Border>
<StackPanel Orientation="Horizontal">
<Label Margin ="3,5,3,5" BorderThickness="1" BorderBrush="Black"
Background="{Binding Path=DefaultColor}"
Content="{Binding Path=LabelName}">
<Label.ContentTemplate>
<DataTemplate>
<Button Background="{Binding Path=DefaultColor}" Content="X" />
</DataTemplate>
</Label.ContentTemplate>
</Label>
</StackPanel>
</Border>
</DataTemplate>