Display the watch list without filling and without a tick

I have this one XAMLto display ListViewin code C++/CX. ListViewwill be used as a selection menu.

<ListView x:Name="itemsListView"
 ItemsSource="{Binding Source={StaticResource MenuDataSourceCVS}}"
 HorizontalAlignment="Stretch"
 Width="230"
 Margin="0,45,0,0"
 VerticalAlignment="Top"
 Grid.Row="1"
 SelectionChanged="itemsListView_SelectionChanged" SelectionMode="Single"
 HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch"
 FontFamily="Global User Interface">
 <ListView.ItemTemplate>
    <DataTemplate>
        <StackPanel Orientation="Horizontal" Height="40" Width="230">
            <TextBlock Text="{Binding Name}"
                Margin="10,5" Width="150" Height="30"
                HorizontalAlignment="Stretch"
                VerticalAlignment="Stretch"/>
            <Border Height="30" Width="30" Margin="5">
                <Image Source="{Binding ImageSrc}" Stretch="Fill"/>
            </Border>
        </StackPanel>
    </DataTemplate>
 </ListView.ItemTemplate>
</ListView>

As you can see in the figure below, the selection does not occupy the entire column and displays a check mark when selected.

ListView Selection with checkmark and padding

Is there any way to eliminate this add-on and checkmark?

+5
source share
1 answer

Blend, " " / " (ItemContainerStyle)" / " ". Style ListViewItem, ListView, . "" , ListViewItem. - , ListViewItem , , . , , , . Blend - , , SelectionStates VisualStatesGroup Selected SelectionBackground Opacity 1 Opacity , , SelectionBackground, " " ( , ). HintGlyphBorder, SelectingGlyph, SelectedCheckMarkOuter.

- , , "" "", ContentBorder Margin "" 0,0,0,0 SelectedBorder.

Blend: enter image description here

+16

All Articles