1

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 プロパティを使用しないことをお勧めします。

前もって感謝します!

4

0 に答える 0