|
|
|
@ -1,5 +1,21 @@ |
|
|
|
<Styles xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> |
|
|
|
<Styles xmlns="https://github.com/avaloniaui" |
|
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
|
|
|
xmlns:converters="clr-namespace:Avalonia.Controls.Converters;assembly=Avalonia.Controls"> |
|
|
|
|
|
|
|
<Design.PreviewWith> |
|
|
|
<Grid ColumnDefinitions="*,20,*" |
|
|
|
Height="300" |
|
|
|
Width="200" |
|
|
|
Margin="20"> |
|
|
|
<ScrollViewer> |
|
|
|
<Border Height="1000" Background="#ccc"/> |
|
|
|
</ScrollViewer> |
|
|
|
<ScrollViewer Grid.Column="2" Classes="menuscroller"> |
|
|
|
<Border Height="1000" Background="#ccc"/> |
|
|
|
</ScrollViewer> |
|
|
|
</Grid> |
|
|
|
</Design.PreviewWith> |
|
|
|
|
|
|
|
<Style Selector="ScrollViewer"> |
|
|
|
<Setter Property="Background" |
|
|
|
Value="Transparent" /> |
|
|
|
@ -66,4 +82,78 @@ |
|
|
|
<Setter Property="Opacity" Value="1" /> |
|
|
|
</Style> |
|
|
|
|
|
|
|
<Style Selector="ScrollViewer.menuscroller"> |
|
|
|
<Setter Property="Template"> |
|
|
|
<ControlTemplate> |
|
|
|
<DockPanel> |
|
|
|
<RepeatButton DockPanel.Dock="Top" |
|
|
|
BorderThickness="0" |
|
|
|
Background="Transparent" |
|
|
|
HorizontalAlignment="Stretch" |
|
|
|
HorizontalContentAlignment="Center" |
|
|
|
RenderTransform="{x:Null}" |
|
|
|
Command="{Binding LineUp, RelativeSource={RelativeSource TemplatedParent}}"> |
|
|
|
<RepeatButton.IsVisible> |
|
|
|
<MultiBinding Converter="{x:Static converters:MenuScrollingVisibilityConverter.Instance}" |
|
|
|
ConverterParameter="0"> |
|
|
|
<Binding RelativeSource="{RelativeSource TemplatedParent}" Path="VerticalScrollBarVisibility"/> |
|
|
|
<Binding RelativeSource="{RelativeSource TemplatedParent}" Path="Offset.Y"/> |
|
|
|
<Binding RelativeSource="{RelativeSource TemplatedParent}" Path="Extent.Height"/> |
|
|
|
<Binding RelativeSource="{RelativeSource TemplatedParent}" Path="Viewport.Height"/> |
|
|
|
</MultiBinding> |
|
|
|
</RepeatButton.IsVisible> |
|
|
|
<Viewbox Width="{DynamicResource ScrollBarButtonArrowIconFontSize}" |
|
|
|
Height="{DynamicResource ScrollBarButtonArrowIconFontSize}"> |
|
|
|
<Path VerticalAlignment="Center" |
|
|
|
HorizontalAlignment="Center" |
|
|
|
Data="M 19.091797 14.970703 L 10 5.888672 L 0.908203 14.970703 L 0.029297 14.091797 L 10 4.111328 L 19.970703 14.091797 Z" |
|
|
|
Width="20" |
|
|
|
Height="20" /> |
|
|
|
</Viewbox> |
|
|
|
</RepeatButton> |
|
|
|
<RepeatButton DockPanel.Dock="Bottom" |
|
|
|
BorderThickness="0" |
|
|
|
Background="Transparent" |
|
|
|
HorizontalAlignment="Stretch" |
|
|
|
HorizontalContentAlignment="Center" |
|
|
|
RenderTransform="{x:Null}" |
|
|
|
Command="{Binding LineDown, RelativeSource={RelativeSource TemplatedParent}}"> |
|
|
|
<RepeatButton.IsVisible> |
|
|
|
<MultiBinding Converter="{x:Static converters:MenuScrollingVisibilityConverter.Instance}" |
|
|
|
ConverterParameter="100"> |
|
|
|
<Binding RelativeSource="{RelativeSource TemplatedParent}" Path="VerticalScrollBarVisibility"/> |
|
|
|
<Binding RelativeSource="{RelativeSource TemplatedParent}" Path="Offset.Y"/> |
|
|
|
<Binding RelativeSource="{RelativeSource TemplatedParent}" Path="Extent.Height"/> |
|
|
|
<Binding RelativeSource="{RelativeSource TemplatedParent}" Path="Viewport.Height"/> |
|
|
|
</MultiBinding> |
|
|
|
</RepeatButton.IsVisible> |
|
|
|
<Viewbox Width="{DynamicResource ScrollBarButtonArrowIconFontSize}" |
|
|
|
Height="{DynamicResource ScrollBarButtonArrowIconFontSize}"> |
|
|
|
<Path VerticalAlignment="Center" |
|
|
|
HorizontalAlignment="Center" |
|
|
|
Data="M 18.935547 4.560547 L 19.814453 5.439453 L 10 15.253906 L 0.185547 5.439453 L 1.064453 4.560547 L 10 13.496094 Z" |
|
|
|
Width="20" |
|
|
|
Height="20" /> |
|
|
|
</Viewbox> |
|
|
|
</RepeatButton> |
|
|
|
<ScrollContentPresenter Name="PART_ContentPresenter" |
|
|
|
CanHorizontallyScroll="{TemplateBinding CanHorizontallyScroll}" |
|
|
|
CanVerticallyScroll="{TemplateBinding CanVerticallyScroll}" |
|
|
|
Content="{TemplateBinding Content}" |
|
|
|
Extent="{TemplateBinding Extent, Mode=TwoWay}" |
|
|
|
Margin="{TemplateBinding Padding}" |
|
|
|
Offset="{TemplateBinding Offset, Mode=TwoWay}" |
|
|
|
Viewport="{TemplateBinding Viewport, Mode=TwoWay}"/> |
|
|
|
</DockPanel> |
|
|
|
</ControlTemplate> |
|
|
|
</Setter> |
|
|
|
</Style> |
|
|
|
<Style Selector="ScrollViewer.menuscroller /template/ RepeatButton > Viewbox > Path"> |
|
|
|
<Setter Property="Fill" Value="{DynamicResource ScrollBarButtonArrowForeground}" /> |
|
|
|
</Style> |
|
|
|
|
|
|
|
<Style Selector="ScrollViewer.menuscroller /template/ RepeatButton:pointerover > Viewbox > Path"> |
|
|
|
<Setter Property="Fill" Value="{DynamicResource ScrollBarButtonArrowForegroundPointerOver}" /> |
|
|
|
</Style> |
|
|
|
|
|
|
|
</Styles> |
|
|
|
|