I have ListPicker where each item is musical instrument. Only one item simultaneously can be selected. In each item beside instrument name there is also button which plays preview sample.
ListPicker template:
<DataTemplate x:Name="ListFullModeItemTemplate">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="auto"/>
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<c4f:RoundButton Grid.Column="0" Tag="{Binding Id}" ImageSource="/Content/AppBarIcons/play.png" Click="instrumentPreview_Click" />
<TextBlock Grid.Column="1" toolkit:TiltEffect.IsTiltEnabled="True" Text="{Binding Name}" VerticalAlignment="Center" FontSize="35"/>
</Grid>
</DataTemplate>
Unfortunately clicking on button automatically closes ListPicker dialog which is not what I want. I thought about marking instrumentPreview_Click event as handled but RoutedEventArgs doesn't have such property in WP7 (unlike WPF)
Instead of the Click
event, use the Tap
event: you'll get a GestureEventArgs instance with a Handled property that you can set to true
!