简体   繁体   中英

how to change scrollbar color in wp8.1

i have this code in one of the pages

  <FlipView ScrollViewer.VerticalScrollBarVisibility="Visible" x:Name="Flip" Grid.Row="1" AutomationProperties.AutomationId="ItemsFlipView" AutomationProperties.Name="Item Details" TabIndex="1"
          DataContext="{Binding RssModel}"
          d:DataContext="{d:DesignData Source=/Assets/Data/RssDataSource.json, Type=vm:RssViewModel, IsDesignTimeCreatable=true}"
          ItemsSource="{Binding Items}"
          ItemTemplate="{StaticResource Rss1DetailDetail}"
          SelectedItem="{Binding SelectedItem, Mode=TwoWay}"
          ItemContainerStyle="{StaticResource FlipItemStyle}">

</FlipView>

i cant see the scrollbar because the background is white and i can see it when i set background to another color. how i can change scrollbar color to app foreground color (globally). i know it should be on styles but i want the exact code for it.

The brushes you find here https://msdn.microsoft.com/en-us/library/windows/apps/xaml/jj710190.aspx can be overridden if you put a new one into your app resources with the same key. For example the key for the scrollbar background is probably the ScrollBarTrackBackgroundThemeBrush , so for a red background just add the line <SolidColorBrush x:Key="ScrollBarTrackBackgroundThemeBrush" Color="Red" /> to your resources.

Edit:

Correct key is: <SolidColorBrush x:Key="ScrollBarPanningBackgroundThemeBrush" Color="#FFCDCDCD"/>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM