Skip to content

Commit

Permalink
Workaround for Issue #4255
Browse files Browse the repository at this point in the history
  • Loading branch information
RBrid committed Mar 11, 2021
1 parent b799f71 commit 3347048
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 10 deletions.
2 changes: 0 additions & 2 deletions dev/CommonStyles/ScrollBar_themeresources.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,6 @@
<x:String x:Key="ScrollBarContractDelay">00:00:02</x:String>
<x:String x:Key="ScrollBarContractFinalKeyframe">00:00:02.1</x:String>
<x:Double x:Key="ScrollBarSize">12</x:Double>
<Thickness x:Key="ScrollBarMargin">1</Thickness>

<x:Double x:Key="ScrollBarVerticalThumbMinHeight">30</x:Double>
<x:Double x:Key="ScrollBarVerticalThumbMinWidth">8</x:Double>
Expand All @@ -213,7 +212,6 @@
<Style x:Key="DefaultScrollBarStyle" TargetType="ScrollBar">
<Setter Property="MinWidth" Value="{StaticResource ScrollBarSize}" />
<Setter Property="MinHeight" Value="{StaticResource ScrollBarSize}" />
<Setter Property="Margin" Value="{StaticResource ScrollBarMargin}"/>
<Setter Property="Background" Value="{ThemeResource ScrollBarBackground}" />
<Setter Property="Foreground" Value="{ThemeResource ScrollBarForeground}" />
<Setter Property="BorderBrush" Value="{ThemeResource ScrollBarBorderBrush}" />
Expand Down
22 changes: 14 additions & 8 deletions dev/ScrollView/ScrollView.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
xmlns:localPrimitives="using:Microsoft.UI.Xaml.Controls.Primitives"
xmlns:contract7Present="http://schemas.microsoft.com/winfx/2006/xaml/presentation?IsApiContractPresent(Windows.Foundation.UniversalApiContract,7)">

<Thickness x:Key="ScrollViewScrollBarMargin">1</Thickness>

<Style TargetType="local:ScrollView" BasedOn="{StaticResource DefaultScrollViewStyle}" />

<Style x:Key="DefaultScrollViewStyle" TargetType="local:ScrollView">
Expand Down Expand Up @@ -217,18 +219,22 @@
MaxZoomFactor="{TemplateBinding MaxZoomFactor}"
HorizontalAnchorRatio="{TemplateBinding HorizontalAnchorRatio}"
VerticalAnchorRatio="{TemplateBinding VerticalAnchorRatio}"/>
<ScrollBar x:Name="PART_HorizontalScrollBar"
<Grid
Grid.Row="1"
Orientation="Horizontal"
HorizontalAlignment="Stretch"
Visibility="{TemplateBinding ComputedHorizontalScrollBarVisibility}"
contract7Present:CornerRadius="{TemplateBinding CornerRadius}"/>
<ScrollBar x:Name="PART_VerticalScrollBar"
Padding="{StaticResource ScrollViewScrollBarMargin}">
<ScrollBar x:Name="PART_HorizontalScrollBar"
Orientation="Horizontal"
contract7Present:CornerRadius="{TemplateBinding CornerRadius}"/>
</Grid>
<Grid
Grid.Column="1"
Orientation="Vertical"
VerticalAlignment="Stretch"
Visibility="{TemplateBinding ComputedVerticalScrollBarVisibility}"
contract7Present:CornerRadius="{TemplateBinding CornerRadius}"/>
Padding="{StaticResource ScrollViewScrollBarMargin}">
<ScrollBar x:Name="PART_VerticalScrollBar"
Orientation="Vertical"
contract7Present:CornerRadius="{TemplateBinding CornerRadius}"/>
</Grid>
<Border x:Name="PART_ScrollBarsSeparator"
Grid.Row="1"
Grid.Column="1"
Expand Down

0 comments on commit 3347048

Please sign in to comment.