My project is utilizing MVVM with C#. I've bounded my button command to a RelayCommand, and I wish to get information about my button. I wish to get this information so that I can use it in my RelayCommand. Unfortunately I do not know how to send this information to my RelayCommand, nor do I know which EventArgs I need to receive in my RelayCommand to get this Information.
<ListBox ItemsSource="{Binding Decoration}" x:Name="MyLB">
<ListBox.ItemTemplate>
<DataTemplate>
<Button BorderBrush="Transparent" BorderThickness="0" Command="{Binding DataContext.AddGearCommand, ElementName=MyLB}" >
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="50"/>
<ColumnDefinition Width="50"/>
</Grid.ColumnDefinitions>
<Grid Grid.Column="0">
<View:ShielGear/>
</Grid>
<TextBlock Text="HEJ MED DIG LUDER" TextWrapping="Wrap" Grid.Column="1"/>
</Grid>
</Button>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
The ShielGear contains a Path element which the button takes it shape after. The RelayCommand I've bounded the command to is:
AddGearCommand = new RelayCommand<T>(addGear);
private void addGear(T e)
{
}
Furthermore is it possible to parse more than one Type to the relaycommand? I am also unsure if I should use Commandparameters?