私は基本的にこのようなListBox
をラップUserControl
を持っている -WPF - FocusVisualStyleどこに適用しますか?
<ListBox x:Name="lb" ItemsSource="{Binding ElementName=UC,Path=Pages}"
Background="{Binding ElementName=UC,Path=Background}"
BorderBrush="Transparent"
ScrollViewer.CanContentScroll="False"
ScrollViewer.HorizontalScrollBarVisibility="Hidden"
ScrollViewer.VerticalScrollBarVisibility="Disabled">
<ListBox.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel Orientation="Horizontal" IsItemsHost="True"/>
</ItemsPanelTemplate>
</ListBox.ItemsPanel>
<ListBox.ItemTemplate>
<DataTemplate>
<Grid Width="{Binding ElementName=UC,Path=ActualWidth}">
<Grid.ColumnDefinitions>
<ColumnDefinition MinWidth="20"/>
<ColumnDefinition/>
<ColumnDefinition MinWidth="20"/>
</Grid.ColumnDefinitions>
<ContentPresenter Grid.Column="1" Content="{Binding}"/>
</Grid>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
私は、この機能を非表示にするFocusVisualStyle
{x:Null}
に設定する必要がありますが、私はそれを適用するに関係なく、私はまだ、デフォルト青選択色を取得します。私はリストボックス、StackPanelとグリッドでそれを設定しようとしたが、役に立たない。
助けがあれば助かります。ありがとう。
ジャにあなたのListBoxをダウングレードすることができるかもしれ、それで行くが、私は中のUIElementをレンダリングしていましたListBoxであり、ItemsControl内のItemTemplateには奇妙なことに従わない。しかし、助けてくれてありがとう。 – Stimul8d