Button と LabelListBox
を保持する があります。DataTemplate
<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}"/>
Button の CommandParameter を以下の Label の Content 値にバインドしたいと思います。別のユーザー インタラクションを示すために選択ハイライトを使用しているため、SelectedItem プロパティを使用しないことをお勧めします。
前もって感謝します!