1
這是我ListView
項後,我作出一些改動:如何改變ListView的邊界時,鼠標上並選擇
<ListView.ItemContainerStyle>
<Style TargetType="{x:Type ListViewItem}">
<Setter Property="Background" Value="Transparent" />
<Setter Property="Foreground" Value="White" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type ListViewItem}">
<Border
BorderBrush="White"
BorderThickness="0"
Background="{TemplateBinding Background}">
<GridViewRowPresenter HorizontalAlignment="Stretch"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
Width="Auto" Margin="0" Content="{TemplateBinding Content}"/>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ListView.ItemContainerStyle>
Background color
是Transparent
和Foreground color
爲White
。
雖然MouseOver
或ListView item selected
什麼都沒有改變,這意味着當期的觀點沒有改變,我想在MouseOver
的BorderColor
更改爲White
,雖然Selected
我想改變BorderColor
藍色。
編輯:
嘗試後的代碼示例這2條線:
<Setter Property="Background" TargetName="Bd" Value="{StaticResource Item.SelectedActive.Background}"/>
<Setter Property="BorderBrush" TargetName="Bd" Value="{StaticResource Item.SelectedActive.Border}"/
收到錯誤的資源Item.SelectedActive.Bachground無法解析和資源Item.SelectedActive.Border不能解決。
請參閱我的更新後,嘗試你的代碼 –
我修改和更新我的代碼。請現在嘗試它的工作確定 – ReeganLourduraj
現在收到的資源FocusVisual無法解析該行Setter Property =「FocusVisualStyle」Value =「{StaticResource FocusVisual}」/> - 這是什麼意思? –