Question

I am attempting to write an applicaiton for WF 7.5 that includes an alphabetical list of recipes. I am using a LongListSelector to display this list as a jump list. Currently, the user can tap the category heading in the list and a grid appears with all of the letters of the alphabet (just like in the music app). Unfortunately, right now the user can select a greyed-out letter from the list and the LLS will put them in the adjacent category. What I would like to happen is for the user to remain in the grid view until they select a category with items in it, or they hit back. I have a variable that tells me if the category has items in it, but im not sure how to use it to disable specific categories in the grid view. I would appreciate any help you can provide!

Was it helpful?

Solution

Just bind your variable to IsHitTestVisible property of the main element in your GroupItemTemplate. Just like that:

<LongListSelector.GroupHeaderTemplate>
    <Border IsHitTestVisible="{Binding CategoryHasItems}">
        <TextBlock Text="{Binding CategoryTitle}"/>
    </Border>
</LongListSelector.GroupHeaderTemplate>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top