Another two solutions work.
1) The rectangle colour's is dynamic, with the key "SystemColors.ControlBrushKey". You can override this key in a custom style, or the resources of the ScrollViewer control (or one of its ancestors). Source: this question on MSDN.
Example :
<!-- In a style --> <Style x:Key="MyCustomScrollViewer" TargetType="{x:Type ScrollViewer}"> <Style.Resources> <SolidColorBrush x:Key="{x:Static SystemColors.ControlBrushKey}" Color="Transparent"/> </Style.Resources> </Style> <!-- Or in the control --> <ScrollViewer> <ScrollViewer.Resources> <SolidColorBrush x:Key="{x:Static SystemColors.ControlBrushKey}" Color="Transparent"/> </ScrollViewer.Resources> </ScrollViewer>
2) Set (same places as above) the style of Rectangle with a "Hidden" visibility. Warning: this will have side-effetcs if rectangles are contained within the control's descendants.
<Style x:Key="MyCustomScrollViewer" TargetType="{x:Type ScrollViewer}"> <Style.Resources> <!-- 'BasedOn' can be omitted --> <Style TargetType="Rectangle" BasedOn="{StaticResource {x:Type Rectangle}}"> <Setter Property="Visibility" Value="Hidden"/> </Style> </Style.Resources> </Style>