Hi everybody,
I have very strange issue. In my WP7 app I have a pivot control and an item template defined inside it(or in the resources, I have tried both ways, but still same issue). In the template I have a regular button with EventToCommand defined(EventName="Click"). I also have the same copy-pasted button outside the Pivot. The problem is that the button, which is outside the pivot is working ok, but the one inside doesn't work. Actually I have noticed, that any command inside my pivot doesn't work. I am handling correctly the Command in the ViewModel, because the same button, but outside the pivot is working great. Any ideas what might be the problem? Help, please. Thanks in advance. Cheers.
P.S. My code is pretty standard, but just in case here it is:
<controls:Pivot Grid.Row="0"
x:Name="PivotControl"
Title="{Binding ApplicationTitle}"
ItemsSource="{Binding BlaBla}">
<controls:Pivot.ItemTemplate>
<DataTemplate>
<StackPanel>
<Button Content="Click Me">
<i:Interaction.Triggers>
<i:EventTrigger EventName="Click">
<cmd:EventToCommand Command="{Binding MyCommand, Mode=OneWay}" CommandParameterValue="Test"/>
</i:EventTrigger>
</i:Interaction.Triggers>
</Button>
...
And the ViewModel code:
public RelayCommand<string> MyCommand
{
get;
private set;
}
//And in the constructor ...
MyCommand= new RelayCommand<string>((param) => HandleTheCommand(param));
...
Thanks again.