In my WP8 application I would like to implement a functionality that is very similar to what is present in standard mail app - an ability for user to select multiple items from list. I've provided some screenshots to illustrate this behavior:
Normal state:
User taps item's left corner and it becomes blue:
Item is selected
My question is if this multiple selection ability is a standard option for some container control or if I should do some custom programming to achieve this? In the latter case, what's the best approach you'd take to implement this, please share your thoughts.
For WP8 Multi-Selection you'll need to use the Windows Phone Toolkit's LongListMultiSelector.
You can find code samples on how to use LongListMultiSelector here (and here for the code behind). Here are the relevant XAML code snippets:
<phone:PivotItem x:Name="BuddiesPivotItem" Header="Std longlistmultiselector">
<toolkit:LongListMultiSelector x:Name="buddies" Background="Transparent"
Margin="0,-8,0,0"
ItemsSource="{StaticResource buddies}"
LayoutMode="List"
IsGroupingEnabled="True"
HideEmptyGroups="True"
JumpListStyle="{StaticResource BuddiesJumpListStyle}"
GroupHeaderTemplate="{StaticResource BuddiesGroupHeaderTemplate}"
ItemTemplate="{StaticResource BuddiesItemTemplate}"
/>
</phone:PivotItem>
<phone:PivotItem x:Name="GridModeItem" Header="Grid mode">
<toolkit:LongListMultiSelector x:Name="GridSelector"
ItemsSource="{StaticResource PicturesAlbum}"
IsGroupingEnabled="False"
GridCellSize="210,180"
LayoutMode="Grid"
HideEmptyGroups="True"
ItemTemplate="{StaticResource PictureItemTemplate}"
IsSelectionEnabledChanged="OnGridSelectorIsSelectionEnabledChanged"
SelectionChanged="OnGridSelectorSelectionChanged"
/>
</phone:PivotItem>
When you run these code snippet you can see the following:
You can read more about the Windows Phone 8 Toolkit here.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With