Extra tap in the Window Phone 7 ListPicker Control

864 views Asked by At

I am using a ListPicker in a Wp7 app. The page that contains the listPicker control also contains a LongListSelector. Each Element of the LongListSelector has a Click Gesture handler.

When I click the ListPicker in appropriately enters the full screen "Full Mode." I click on a selection and the full mode appropriately closes. Then another tap is registered on the parent page of the ListPicker, directly under the spot where I clicked the Full Mode window to make the solution. I can activate both the index view or the elements of the LongListSelector.

It appears that the ListPicker is failing to mark the tap event as handled, and it is bubblling up. Has anyone else noticed this behavior? Any workarrounds?

1

There are 1 answers

0
nadeemmar On BEST ANSWER

This is a sort of work around which worked for me when I had the same problem:

You need to add a FullHeaderItemTemplate with a handle to load and unload events.

<toolkit:ListPicker.FullModeItemTemplate>
   <DataTemplate>
     <Grid Margin="12,15,12,15">
       <TextBlock Text="{Binding FullName}"
                  Loaded="TextBlockLoaded"
                  Unloaded="TextBlockUnloaded"
                  Style="{Binding PhoneTextExtraLargeStyle}" />
     </Grid>
   </DataTemplate>
</toolkit:ListPicker.FullModeItemTemplate>

for the events, you need to have the following:

    private void TextBlockLoaded(object sender, RoutedEventArgs e)
    {
        LayoutRoot.IsHitTestVisible = false;
    }

    private void TextBlockUnloaded(object sender, RoutedEventArgs e)
    {
        LayoutRoot.IsHitTestVisible = true;
    }