You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
69 lines
4.2 KiB
69 lines
4.2 KiB
<ResourceDictionary xmlns="https://github.com/avaloniaui" |
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
|
xmlns:scroll="clr-namespace:StabilityMatrix.Avalonia.Controls.Scroll"> |
|
<Design.PreviewWith> |
|
<scroll:BetterScrollViewer Width="200" Height="200" |
|
HorizontalScrollBarVisibility="Auto"> |
|
<StackPanel Spacing="20" Width="210"> |
|
<TextBlock>Item 1</TextBlock> |
|
<TextBlock>Item 2</TextBlock> |
|
<TextBlock>Item 3</TextBlock> |
|
<TextBlock>Item 4</TextBlock> |
|
<TextBlock>Item 5</TextBlock> |
|
<TextBlock>Item 6</TextBlock> |
|
<TextBlock>Item 7</TextBlock> |
|
<TextBlock>Item 8</TextBlock> |
|
<TextBlock>Item 9</TextBlock> |
|
</StackPanel> |
|
</scroll:BetterScrollViewer> |
|
</Design.PreviewWith> |
|
|
|
<ControlTheme x:Key="{x:Type scroll:BetterScrollViewer}" TargetType="scroll:BetterScrollViewer"> |
|
<Setter Property="Background" Value="Transparent" /> |
|
<Setter Property="Template"> |
|
<ControlTemplate> |
|
<Grid ColumnDefinitions="*,Auto" RowDefinitions="*,Auto"> |
|
<scroll:BetterScrollContentPresenter x:Name="PART_ContentPresenter" |
|
Grid.Row="0" |
|
Grid.Column="0" |
|
Grid.RowSpan="2" |
|
Grid.ColumnSpan="2" |
|
Background="{TemplateBinding Background}" |
|
HorizontalSnapPointsType="{TemplateBinding HorizontalSnapPointsType}" |
|
VerticalSnapPointsType="{TemplateBinding VerticalSnapPointsType}" |
|
HorizontalSnapPointsAlignment="{TemplateBinding HorizontalSnapPointsAlignment}" |
|
VerticalSnapPointsAlignment="{TemplateBinding VerticalSnapPointsAlignment}" |
|
Padding="{TemplateBinding Padding}" |
|
ScrollViewer.IsScrollInertiaEnabled="{TemplateBinding IsScrollInertiaEnabled}"> |
|
<scroll:BetterScrollContentPresenter.GestureRecognizers> |
|
<ScrollGestureRecognizer |
|
CanHorizontallyScroll="{Binding CanHorizontallyScroll, ElementName=PART_ContentPresenter}" |
|
CanVerticallyScroll="{Binding CanVerticallyScroll, ElementName=PART_ContentPresenter}" |
|
IsScrollInertiaEnabled="{Binding (ScrollViewer.IsScrollInertiaEnabled), ElementName=PART_ContentPresenter}" /> |
|
</scroll:BetterScrollContentPresenter.GestureRecognizers> |
|
</scroll:BetterScrollContentPresenter> |
|
<ScrollBar Name="PART_HorizontalScrollBar" |
|
Orientation="Horizontal" |
|
Grid.Row="1" /> |
|
<ScrollBar Name="PART_VerticalScrollBar" |
|
Orientation="Vertical" |
|
Grid.Column="1" /> |
|
<Panel x:Name="PART_ScrollBarsSeparator" |
|
Grid.Row="1" |
|
Grid.Column="1" |
|
Background="{DynamicResource ScrollViewerScrollBarsSeparatorBackground}" |
|
Opacity="0"> |
|
<Panel.Transitions> |
|
<Transitions> |
|
<DoubleTransition Property="Opacity" Duration="0:0:0.1" /> |
|
</Transitions> |
|
</Panel.Transitions> |
|
</Panel> |
|
</Grid> |
|
</ControlTemplate> |
|
</Setter> |
|
<Style Selector="^[IsExpanded=true] /template/ Panel#PART_ScrollBarsSeparator"> |
|
<Setter Property="Opacity" Value="1" /> |
|
</Style> |
|
</ControlTheme> |
|
</ResourceDictionary>
|
|
|