我有这个模板LongListSelector
:
<local:SearchTemplateSelector.LoadMoreTemplate>
<DataTemplate>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<TextBlock Text="Load more..." FontSize="30" Foreground="White" TextWrapping="Wrap" Grid.Row="0"
HorizontalAlignment="Center" VerticalAlignment="Center" Margin="0,35"/>
<Rectangle Height="1" HorizontalAlignment="Stretch" VerticalAlignment="Top" Fill="White" Grid.Row="1" Opacity="0.3"/>
</Grid>
</DataTemplate>
</local:SearchTemplateSelector.LoadMoreTemplate>
这是LongListSelector
:
<Controls:LongListSelector x:Name="searchList" Margin="0,0,0,0" Background="Black" SelectionChanged="DidPressSelectSearchList"
HorizontalContentAlignment="Stretch" KeyDown="UserPressEnterKeyBoard" Grid.Row="1">
<Controls:LongListSelector.ItemTemplate>
<DataTemplate>
<local:SearchTemplateSelector Content="{Binding}" HorizontalContentAlignment="Stretch">
我有一个问题,当我按下列表中的这一行时,DidPressSelectSearchList
只有当我按下时才会被调用,TextBlock
如果我按下行上的另一个位置则不会触发。
知道如何解决吗?
编辑我试试这个:
<local:SearchTemplateSelector Content="{Binding}" HorizontalContentAlignment="Stretch" Background="Transparent">
它仍然无法正常工作。