I am using mvvm light in a WP7 app. I have a listbox with an itemsource of a collection of objects. The ItemTemplate DataTemplate for the listbox contains a button. The button contains a textblock that displayes a property from the bound object. How do I assign the Command to the button without changing the datacontext the textblock or the CommandParameter that gets the item bound to the itemtemplate?
<ListBox x:Name="listBox" ItemsSource="{Binding Main.SomeCollection}" >
<ListBox.ItemTemplate>
<DataTemplate>
<Button
Command:ButtonBaseExtensions.Command="{Binding Main.MyCommand}"
Cmmand:ButtonBaseExtensions.CommandParameter="{Binding}" />
<TextBlock Text="{Binding Title}"/>
</Button>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
Thanks