WinRT - Listview custom selection

230 views Asked by At

I'm trying to achieve custom selection of selected item in listview. In default, selected item has border around it. I wanted to add CornerRadius to it but couldn't. So I decided to add my own border in ItemTemplate and make it visible for the currently selected item only.

Here's my ItemTemplate for Listview:

 <ListView.ItemTemplate>
     <DataTemplate>
         <Grid>
             <Border Height="73"
                     Width="73">
                 <Image Stretch="UniformToFill"
                        VerticalAlignment="Center"
                        HorizontalAlignment="Center"
                        Source="{Binding ImgPath}">
                 </Image>
             </Border>
             <Border x:Name="CornerRadiusBorder"
                     Height="78"
                     Width="77"
                     BorderBrush="Blue"
                     BorderThickness="3"
                     CornerRadius="3">
             </Border>
         </Grid>
    </DataTemplate>
</ListView.ItemTemplate>

I want to make CornerRadiusBorder visible only for selected item.

0

There are 0 answers