0
私はリストビューを持っていますが、選択モードが単一であってもリストビューに複数の選択がありますか?listviewとitemcontainerstyleにプロパティを設定しました。リストビューは選択モードを1つでも設定しても複数選択できますか?
<ListView SelectionMode="Single" Tapped="UIElementTapped"
ItemsSource="{Binding Path=ListTimeFrame}"
SelectedItem="{Binding Path=SelectedTimeFrame, Mode=TwoWay}"
ItemContainerStyle="{StaticResource TimeFrameListViewItemContainerStyle}"
Padding="0"
Margin="0">
とitemcontainerスタイルは次のよう
<Style x:Key="TimeFrameListViewItemContainerStyle" TargetType="ListViewItem">
<Setter Property="Padding" Value="4,1" />
<Setter Property="Background" Value="Transparent" />
<Setter Property="BorderBrush" Value="Transparent" />
<Setter Property="BorderThickness" Value="1" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="ListViewItem">
<Border x:Name="Bd" BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
Background="{TemplateBinding Background}" Padding="{TemplateBinding Padding}"
>
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="SelectionStates">
<VisualState x:Name="Unselected" />
<VisualState x:Name="Selected">
<Storyboard>
<DoubleAnimation Storyboard.TargetName="SelectingGlyph"
Storyboard.TargetProperty="Opacity" Duration="0" To="1" />
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="contentPresenter"
Storyboard.TargetProperty="Foreground">
<DiscreteObjectKeyFrame KeyTime="0"
Value="{StaticResource DefaultTextBlueColor}" />
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
<VisualState x:Name="SelectedUnfocused" />
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
<Grid Margin="{TemplateBinding Padding}">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<TextBlock Text="" FontFamily="Segoe UI Symbol"
Foreground="{StaticResource DefaultTextBlueColor}" x:Name="SelectingGlyph"
Opacity="0" FontSize="20" LineStackingStrategy="BlockLineHeight" />
<ContentPresenter x:Name="contentPresenter" Grid.Column="1"
ContentTransitions="{TemplateBinding ContentTransitions}"
ContentTemplate="{TemplateBinding ContentTemplate}"
Content="{TemplateBinding Content}"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />
</Grid>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>