Skip to content

Latest commit

 

History

History
38 lines (32 loc) · 1.24 KB

kb-common-change-fluentpalette-scrollbarsmode-per-control.md

File metadata and controls

38 lines (32 loc) · 1.24 KB
title description page_title slug position tags ticketid res_type
Set the FluentPalette ScrollBarsMode on a Single Control
Replace the ThemeHelper.ScrollBarsMode attached property for a specific ScrollViewer control.
Change ScrollBarsMode per Control in the Fluent Theme
kb-common-change-fluentpalette-scrollbarsmode-per-control
0
change,scrollbarsmode,themehelper
1472946
kb

Environment

Product UI for WPF

Description

How to change the ThemeHelper.ScrollBarsMode attached property for a specific ScrollViewer control, this customizing the scrollbars in the Fluent theme.

Solution

To do this, you can add an implicit style in the Resources of the corresponding ScrollViewer control. The Style can have a single Setter changing the ThemeHelper.ScrollBarsMode attached property.

[XAML]

{{region kb-common-change-fluentpalette-scrollbarsmode-per-control-0}} <ScrollViewer.Resources> <Style TargetType="ScrollBar" BasedOn="{StaticResource ScrollBarStyle}"> </Style> </ScrollViewer.Resources> {{endregion}}