123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256 |
- <Styles xmlns="https://github.com/avaloniaui"
- xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
- xmlns:content="clr-namespace:SukiUI.Content"
- xmlns:converters="clr-namespace:SukiUI.Converters"
- xmlns:theme="clr-namespace:SukiUI.Theme">
- <Design.PreviewWith>
- <StackPanel Width="200">
- <Border Padding="20">
- <ScrollViewer Width="200"
- Height="100"
- >
- <StackPanel>
- <ListBoxItem>isse</ListBoxItem>
- <ListBoxItem>isse</ListBoxItem>
- <ListBoxItem>isse</ListBoxItem>
- <ListBoxItem>isse</ListBoxItem>
- <ListBoxItem>isse</ListBoxItem>
- <ListBoxItem>isse</ListBoxItem>
- <ListBoxItem>isse</ListBoxItem>
- <ListBoxItem>isse</ListBoxItem>
- <ListBoxItem>isse</ListBoxItem>
- <ListBoxItem>isse</ListBoxItem>
- <ListBoxItem>isse</ListBoxItem>
- <ListBoxItem>isse</ListBoxItem>
- <ListBoxItem>isse</ListBoxItem>
- <ListBoxItem>isse</ListBoxItem>
- <ListBoxItem>isse</ListBoxItem>
- <ListBoxItem>isse</ListBoxItem>
- <ListBoxItem>isse</ListBoxItem>
- <ListBoxItem>isse</ListBoxItem>
- <ListBoxItem>isse</ListBoxItem>
- <ListBoxItem>isse</ListBoxItem>
- <ListBoxItem>isse</ListBoxItem>
- <ListBoxItem>isse</ListBoxItem>
- <ListBoxItem>isse</ListBoxItem>
- <ListBoxItem>isse</ListBoxItem>
- <ListBoxItem>isse</ListBoxItem>
- <ListBoxItem>isse</ListBoxItem>
- <ListBoxItem>isse</ListBoxItem>
- <ListBoxItem>isse</ListBoxItem>
- <ListBoxItem>isse</ListBoxItem>
- <ListBoxItem>isse</ListBoxItem>
- </StackPanel>
- </ScrollViewer>
- </Border>
- <ScrollViewer HorizontalScrollBarVisibility="Visible" VerticalScrollBarVisibility="Auto">
- <StackPanel Width="500" Orientation="Horizontal">
- <Panel Width="50"
- Height="50"
- Margin="5"
- Background="Gray" />
- <Panel Width="50"
- Height="50"
- Margin="5"
- Background="Gray" />
- <Panel Width="50"
- Height="50"
- Margin="5"
- Background="Gray" />
- <Panel Width="50"
- Height="50"
- Margin="5"
- Background="Gray" />
- <Panel Width="50"
- Height="50"
- Margin="5"
- Background="Gray" />
- </StackPanel>
- </ScrollViewer>
- </StackPanel>
- </Design.PreviewWith>
- <Style Selector="ScrollBar:vertical">
- <Setter Property="AllowAutoHide" Value="False"></Setter>
- <Setter Property="Template">
- <ControlTemplate>
- <Border Background="Transparent" UseLayoutRounding="False">
- <Grid RowDefinitions="Auto,*,Auto">
- <Track Grid.Row="1"
- Grid.Column="1"
- IsDirectionReversed="True"
- Maximum="{TemplateBinding Maximum}"
- Minimum="{TemplateBinding Minimum}"
- Orientation="{TemplateBinding Orientation}"
- ViewportSize="{TemplateBinding ViewportSize}"
- Value="{TemplateBinding Value,
- Mode=TwoWay}">
- <Track.DecreaseButton>
- <RepeatButton Name="PART_PageUpButton"
- Background="Transparent"
- Classes="repeattrack"
- Focusable="False" />
- </Track.DecreaseButton>
- <Track.IncreaseButton>
- <RepeatButton Name="PART_PageDownButton"
- Background="Transparent"
- Classes="repeattrack"
- Focusable="False" />
- </Track.IncreaseButton>
- <Thumb Name="thumb">
-
- <Thumb.Template>
- <ControlTemplate>
- <Panel>
-
- <Border Name="ThumbBarVertical" Margin="0,3" Width="3"
- Background="{DynamicResource SukiMediumBorderBrush}"
- CornerRadius="{DynamicResource MediumCornerRadius}" >
-
- <Border.Transitions>
- <Transitions>
- <BrushTransition Property="Background" Duration="0:0:0.15"></BrushTransition>
- <DoubleTransition Property="Width" Duration="0:0:0.1"></DoubleTransition>
- </Transitions>
- </Border.Transitions>
- </Border>
- </Panel>
- </ControlTemplate>
- </Thumb.Template>
- </Thumb>
- </Track>
- </Grid>
- </Border>
- </ControlTemplate>
- </Setter>
- </Style>
-
-
- <Style Selector="ScrollBar.Stack:vertical">
- <Setter Property="HorizontalAlignment" Value="Stretch" />
- <Setter Property="Width" Value="NaN" />
- <Setter Property="Template">
- <ControlTemplate>
- <Grid HorizontalAlignment="Stretch" RowDefinitions="Auto,*,Auto">
- <RepeatButton Name="PART_PageUpButton"
- Height="60"
- HorizontalAlignment="Stretch"
- Background="Transparent"
- BorderThickness="0"
- Focusable="False">
- <RepeatButton.IsVisible>
- <MultiBinding Converter="{x:Static converters:SideMenuScrollerToVisibilityBool.Up}">
- <Binding Path="Value" RelativeSource="{RelativeSource TemplatedParent}" />
- <Binding Path="Minimum" RelativeSource="{RelativeSource TemplatedParent}" />
- </MultiBinding>
- </RepeatButton.IsVisible>
- <PathIcon Width="10"
- Height="25"
- Data="{x:Static content:Icons.ChevronUp}"
- Foreground="{DynamicResource SukiText}">
- <PathIcon.RenderTransform>
- <ScaleTransform ScaleX="1" />
- </PathIcon.RenderTransform>
- </PathIcon>
- </RepeatButton>
- <RepeatButton Name="PART_PageDownButton"
- Grid.Row="2"
- Height="60"
- HorizontalAlignment="Stretch"
- Background="Transparent"
- BorderThickness="0"
- Focusable="False">
- <RepeatButton.IsVisible>
- <MultiBinding Converter="{x:Static converters:SideMenuScrollerToVisibilityBool.Down}">
- <Binding Path="Value" RelativeSource="{RelativeSource TemplatedParent}" />
- <Binding Path="Maximum" RelativeSource="{RelativeSource TemplatedParent}" />
- </MultiBinding>
- </RepeatButton.IsVisible>
- <PathIcon Width="10"
- Height="25"
- Data="{x:Static content:Icons.ChevronDown}"
- Foreground="{DynamicResource SukiText}">
- <PathIcon.RenderTransform>
- <ScaleTransform ScaleX="1" />
- </PathIcon.RenderTransform>
- </PathIcon>
- </RepeatButton>
- </Grid>
- </ControlTemplate>
- </Setter>
- </Style>
- <Style Selector="ScrollBar:horizontal">
- <Setter Property="AllowAutoHide" Value="False"></Setter>
- <Setter Property="Template">
- <ControlTemplate>
- <Border Background="Transparent" UseLayoutRounding="False">
- <Grid >
- <Track
- IsDirectionReversed="False"
- Maximum="{TemplateBinding Maximum}"
- Minimum="{TemplateBinding Minimum}"
- Orientation="{TemplateBinding Orientation}"
- ViewportSize="{TemplateBinding ViewportSize}"
- Value="{TemplateBinding Value,
- Mode=TwoWay}">
- <Track.DecreaseButton>
- <RepeatButton Name="PART_PageUpButton"
- Background="Transparent"
- Classes="repeattrack"
- Focusable="False" />
- </Track.DecreaseButton>
- <Track.IncreaseButton>
- <RepeatButton Name="PART_PageDownButton"
- Background="Transparent"
- Classes="repeattrack"
- Focusable="False" />
- </Track.IncreaseButton>
- <Thumb Name="thumb">
- <Thumb.Template>
- <ControlTemplate>
- <Panel>
- <Border Height="3" Name="ThumbBarHorizontal"
- Margin="3,0"
- Background="{DynamicResource SukiMediumBorderBrush}"
- CornerRadius="10" >
- <Border.Transitions>
- <Transitions>
- <BrushTransition Property="Background" Duration="0:0:0.15"></BrushTransition>
- <DoubleTransition Property="Height" Duration="0:0:0.1"></DoubleTransition>
- </Transitions>
- </Border.Transitions>
- </Border>
- </Panel>
- </ControlTemplate>
- </Thumb.Template>
- </Thumb>
- </Track>
- </Grid>
- </Border>
- </ControlTemplate>
- </Setter>
- </Style>
-
-
- <Style Selector="ScrollViewer:pointerover /template/ ScrollBar">
- <Setter Property="AllowAutoHide" Value="True"></Setter>
- </Style>
-
- <Style Selector="ScrollBar[AllowAutoHide=True] Border#ThumbBarVertical">
- <Setter Property="Background" Value="{DynamicResource SukiControlBorderBrush}"></Setter>
- <Setter Property="Width" Value="8"></Setter>
- </Style>
-
- <Style Selector="ScrollBar[AllowAutoHide=True] Border#ThumbBarHorizontal">
- <Setter Property="Background" Value="{DynamicResource SukiControlBorderBrush}"></Setter>
- <Setter Property="Height" Value="8"></Setter>
- </Style>
-
- </Styles>
|