0
我有一個列表框,誰的itemsource綁定到SelectionMode =「Single」的列表。我的列表框也有一個ItemContainerStyle爲它設置如下:刪除後不能從列表框中選擇相同的項目
<ListView.ItemContainerStyle>
<Style TargetType="{x:Type ListViewItem}">
<Style.Resources>
<SolidColorBrush x:Key="{x:Static SystemColors.HighlightBrushKey}" Color="Transparent" />
<SolidColorBrush x:Key="{x:Static SystemColors.ControlBrushKey}" Color="Transparent" />
</Style.Resources>
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" Value="Blue" />
</Trigger>
</Style.Triggers>
</Style>
</ListView.ItemContainerStyle>
當我刪除列表中的一個項目,我不能,除非我選擇不同的項目重新選擇項目,然後回去吧。任何人都可以對此提出意見嗎?
我會怎麼做,使用MVVM? – user1884032
您可以發佈一些代碼,瞭解您當前如何從列表中移除項目?如果我看到您目前的實施情況,我將能夠幫助您。 – Mash