I have a list view, which items are defined using ItemsSource
.
The ItemsSource
is a list of local class type.
I need to send as a CommandParameter
the selected items DataType
.
Can someone help me with this?
Code: (This code is in the App.xaml and the data template is inside an itemsTemplate tag)
<Application.Resources>
<DataTemplate x:Key="xxx" DataType="BL:DeviceInfo">
<StackPanel>
<Button Command="{Binding DataContext.SelectDeviceCommand RelativeSource={RelativeSource ancestorType=ListView}} CommandParameter="{???????}" />
</StackPanel>
</DataTemplate>
</Application.Resources>
I wand to send the SelectedItem as a Deviceinfo , which is the type of the items of the list that is the items source of the list view.