I have a ListBox
whose DataTemplate
holds a Button and Label:
<ListBox.ItemTemplate>
<DataTemplate>
<DockPanel>
<Button DockPanel.Dock="Left" Command="{Binding DataContext.AddToBoxCmd, RelativeSource={RelativeSource FindAncestor, AncestorType=UserControl, AncestorLevel=1}}"
CommandParameter=???/> <--How to bind command parameter here to Label's content below
<Label x:Name="PartNumberLabel" Content="{Binding Path=Element[PartNumber].Value}"/>
I would like to bind the Button's CommandParameter to the Label's Content value below. I would prefer to not use the SelectedItem property, as I'm using the selection highlight to indicate a different user interaction.
Thanks in advance!