feat: init avalonia demo.
This commit is contained in:
1 parent
adb6355884
commit
63bf5c6aa7
95 files changed
+20896
-2634
No files matched your search
@@ -0,0 +1,20 @@
|
||||
<ResourceDictionary xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
<ControlTheme x:Key="{x:Type Border}"
|
||||
TargetType="Border">
|
||||
<Style Selector="^.clip">
|
||||
<Setter Property="Clip">
|
||||
<Setter.Value>
|
||||
<MultiBinding Converter="{StaticResource BorderClipConverter}">
|
||||
<Binding Path="ActualWidth"
|
||||
RelativeSource="{RelativeSource Self}" />
|
||||
<Binding Path="ActualHeight"
|
||||
RelativeSource="{RelativeSource Self}" />
|
||||
<Binding Path="CornerRadius"
|
||||
RelativeSource="{RelativeSource Self}" />
|
||||
</MultiBinding>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
</ControlTheme>
|
||||
</ResourceDictionary>
|
||||
@@ -1,102 +1,141 @@
|
||||
<ResourceDictionary xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
<ControlTheme x:Key="{x:Type Button}" TargetType="Button">
|
||||
<Setter Property="Background" Value="{DynamicResource RegionBrush}" />
|
||||
<Setter Property="Foreground" Value="{DynamicResource PrimaryTextBrush}" />
|
||||
<Setter Property="BorderBrush" Value="{DynamicResource BorderBrush}" />
|
||||
<Setter Property="BorderThickness" Value="1" />
|
||||
<Setter Property="CornerRadius" Value="{DynamicResource DefaultCornerRadius}" />
|
||||
<Setter Property="Padding" Value="{DynamicResource DefaultControlPadding}" />
|
||||
<Setter Property="HorizontalAlignment" Value="Center" />
|
||||
<Setter Property="VerticalAlignment" Value="Center" />
|
||||
<Setter Property="HorizontalContentAlignment" Value="Center" />
|
||||
<Setter Property="VerticalContentAlignment" Value="Center" />
|
||||
<Setter Property="Template">
|
||||
<ControlTemplate TargetType="Button">
|
||||
<ContentPresenter x:Name="PART_ContentPresenter"
|
||||
Background="{TemplateBinding Background}"
|
||||
BorderBrush="{TemplateBinding BorderBrush}"
|
||||
BorderThickness="{TemplateBinding BorderThickness}"
|
||||
CornerRadius="{TemplateBinding CornerRadius}"
|
||||
Content="{TemplateBinding Content}"
|
||||
ContentTemplate="{TemplateBinding ContentTemplate}"
|
||||
Padding="{TemplateBinding Padding}"
|
||||
RecognizesAccessKey="True"
|
||||
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
|
||||
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" />
|
||||
</ControlTemplate>
|
||||
</Setter>
|
||||
<ControlTheme x:Key="{x:Type Button}"
|
||||
TargetType="Button">
|
||||
<Setter Property="Background"
|
||||
Value="{DynamicResource RegionBrush}" />
|
||||
<Setter Property="Foreground"
|
||||
Value="{DynamicResource PrimaryTextBrush}" />
|
||||
<Setter Property="BorderBrush"
|
||||
Value="{DynamicResource BorderBrush}" />
|
||||
<Setter Property="BorderThickness"
|
||||
Value="1" />
|
||||
<Setter Property="CornerRadius"
|
||||
Value="{DynamicResource DefaultCornerRadius}" />
|
||||
<Setter Property="Padding"
|
||||
Value="{DynamicResource DefaultControlPadding}" />
|
||||
<Setter Property="HorizontalAlignment"
|
||||
Value="Center" />
|
||||
<Setter Property="VerticalAlignment"
|
||||
Value="Center" />
|
||||
<Setter Property="HorizontalContentAlignment"
|
||||
Value="Center" />
|
||||
<Setter Property="VerticalContentAlignment"
|
||||
Value="Center" />
|
||||
<Setter Property="Template">
|
||||
<ControlTemplate TargetType="Button">
|
||||
<ContentPresenter x:Name="PART_ContentPresenter"
|
||||
Background="{TemplateBinding Background}"
|
||||
BorderBrush="{TemplateBinding BorderBrush}"
|
||||
BorderThickness="{TemplateBinding BorderThickness}"
|
||||
CornerRadius="{TemplateBinding CornerRadius}"
|
||||
Content="{TemplateBinding Content}"
|
||||
ContentTemplate="{TemplateBinding ContentTemplate}"
|
||||
Padding="{TemplateBinding Padding}"
|
||||
RecognizesAccessKey="True"
|
||||
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
|
||||
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" />
|
||||
</ControlTemplate>
|
||||
</Setter>
|
||||
|
||||
<Style Selector="^:pointerover">
|
||||
<Setter Property="Background" Value="{DynamicResource SecondaryRegionBrush}" />
|
||||
</Style>
|
||||
<Style Selector="^:pointerover">
|
||||
<Setter Property="Background"
|
||||
Value="{DynamicResource SecondaryRegionBrush}" />
|
||||
</Style>
|
||||
|
||||
<Style Selector="^:pressed">
|
||||
<Setter Property="Background" Value="{DynamicResource BorderBrush}" />
|
||||
</Style>
|
||||
<Style Selector="^:pressed">
|
||||
<Setter Property="Background"
|
||||
Value="{DynamicResource BorderBrush}" />
|
||||
</Style>
|
||||
|
||||
<Style Selector="^:disabled">
|
||||
<Setter Property="Opacity" Value=".4" />
|
||||
</Style>
|
||||
<Style Selector="^:disabled">
|
||||
<Setter Property="Opacity"
|
||||
Value=".4" />
|
||||
</Style>
|
||||
|
||||
<Style Selector="^.primary">
|
||||
<Setter Property="Foreground" Value="{DynamicResource TextIconBrush}" />
|
||||
<Setter Property="Background" Value="{DynamicResource PrimaryBrush}" />
|
||||
<Setter Property="BorderBrush" Value="{DynamicResource PrimaryBrush}" />
|
||||
<Style Selector="^.primary">
|
||||
<Setter Property="Foreground"
|
||||
Value="{DynamicResource TextIconBrush}" />
|
||||
<Setter Property="Background"
|
||||
Value="{DynamicResource PrimaryBrush}" />
|
||||
<Setter Property="BorderBrush"
|
||||
Value="{DynamicResource PrimaryBrush}" />
|
||||
<Style Selector="^:pointerover">
|
||||
<Setter Property="Opacity" Value=".9" />
|
||||
<Setter Property="Opacity"
|
||||
Value=".9" />
|
||||
</Style>
|
||||
<Style Selector="^:pressed">
|
||||
<Setter Property="Opacity" Value=".6" />
|
||||
<Setter Property="Opacity"
|
||||
Value=".6" />
|
||||
</Style>
|
||||
</Style>
|
||||
</Style>
|
||||
|
||||
<Style Selector="^.success">
|
||||
<Setter Property="Foreground" Value="{DynamicResource TextIconBrush}" />
|
||||
<Setter Property="Background" Value="{DynamicResource SuccessBrush}" />
|
||||
<Setter Property="BorderBrush" Value="{DynamicResource SuccessBrush}" />
|
||||
<Setter Property="Foreground"
|
||||
Value="{DynamicResource TextIconBrush}" />
|
||||
<Setter Property="Background"
|
||||
Value="{DynamicResource SuccessBrush}" />
|
||||
<Setter Property="BorderBrush"
|
||||
Value="{DynamicResource SuccessBrush}" />
|
||||
<Style Selector="^:pointerover">
|
||||
<Setter Property="Opacity" Value=".9" />
|
||||
<Setter Property="Opacity"
|
||||
Value=".9" />
|
||||
</Style>
|
||||
<Style Selector="^:pressed">
|
||||
<Setter Property="Opacity" Value=".6" />
|
||||
<Setter Property="Opacity"
|
||||
Value=".6" />
|
||||
</Style>
|
||||
</Style>
|
||||
|
||||
<Style Selector="^.info">
|
||||
<Setter Property="Foreground" Value="{DynamicResource TextIconBrush}" />
|
||||
<Setter Property="Background" Value="{DynamicResource InfoBrush}" />
|
||||
<Setter Property="BorderBrush" Value="{DynamicResource InfoBrush}" />
|
||||
<Setter Property="Foreground"
|
||||
Value="{DynamicResource TextIconBrush}" />
|
||||
<Setter Property="Background"
|
||||
Value="{DynamicResource InfoBrush}" />
|
||||
<Setter Property="BorderBrush"
|
||||
Value="{DynamicResource InfoBrush}" />
|
||||
<Style Selector="^:pointerover">
|
||||
<Setter Property="Opacity" Value=".9" />
|
||||
<Setter Property="Opacity"
|
||||
Value=".9" />
|
||||
</Style>
|
||||
<Style Selector="^:pressed">
|
||||
<Setter Property="Opacity" Value=".6" />
|
||||
<Setter Property="Opacity"
|
||||
Value=".6" />
|
||||
</Style>
|
||||
</Style>
|
||||
|
||||
<Style Selector="^.warning">
|
||||
<Setter Property="Foreground" Value="{DynamicResource TextIconBrush}" />
|
||||
<Setter Property="Background" Value="{DynamicResource WarningBrush}" />
|
||||
<Setter Property="BorderBrush" Value="{DynamicResource WarningBrush}" />
|
||||
<Setter Property="Foreground"
|
||||
Value="{DynamicResource TextIconBrush}" />
|
||||
<Setter Property="Background"
|
||||
Value="{DynamicResource WarningBrush}" />
|
||||
<Setter Property="BorderBrush"
|
||||
Value="{DynamicResource WarningBrush}" />
|
||||
<Style Selector="^:pointerover">
|
||||
<Setter Property="Opacity" Value=".9" />
|
||||
<Setter Property="Opacity"
|
||||
Value=".9" />
|
||||
</Style>
|
||||
<Style Selector="^:pressed">
|
||||
<Setter Property="Opacity" Value=".6" />
|
||||
<Setter Property="Opacity"
|
||||
Value=".6" />
|
||||
</Style>
|
||||
</Style>
|
||||
|
||||
<Style Selector="^.danger">
|
||||
<Setter Property="Foreground" Value="{DynamicResource TextIconBrush}" />
|
||||
<Setter Property="Background" Value="{DynamicResource DangerBrush}" />
|
||||
<Setter Property="BorderBrush" Value="{DynamicResource DangerBrush}" />
|
||||
<Setter Property="Foreground"
|
||||
Value="{DynamicResource TextIconBrush}" />
|
||||
<Setter Property="Background"
|
||||
Value="{DynamicResource DangerBrush}" />
|
||||
<Setter Property="BorderBrush"
|
||||
Value="{DynamicResource DangerBrush}" />
|
||||
<Style Selector="^:pointerover">
|
||||
<Setter Property="Opacity" Value=".9" />
|
||||
<Setter Property="Opacity"
|
||||
Value=".9" />
|
||||
</Style>
|
||||
<Style Selector="^:pressed">
|
||||
<Setter Property="Opacity" Value=".6" />
|
||||
<Setter Property="Opacity"
|
||||
Value=".6" />
|
||||
</Style>
|
||||
</Style>
|
||||
</ControlTheme>
|
||||
</ControlTheme>
|
||||
</ResourceDictionary>
|
||||
@@ -1,19 +1,19 @@
|
||||
<ResourceDictionary xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
<ControlTheme x:Key="{x:Type ContentControl}" TargetType="ContentControl">
|
||||
<ControlTheme x:Key="{x:Type ContentControl}"
|
||||
TargetType="ContentControl">
|
||||
<Setter Property="Template">
|
||||
<ControlTemplate TargetType="ContentControl">
|
||||
<ContentPresenter
|
||||
Name="PART_ContentPresenter"
|
||||
Padding="{TemplateBinding Padding}"
|
||||
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
|
||||
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
|
||||
Background="{TemplateBinding Background}"
|
||||
BorderBrush="{TemplateBinding BorderBrush}"
|
||||
BorderThickness="{TemplateBinding BorderThickness}"
|
||||
Content="{TemplateBinding Content}"
|
||||
ContentTemplate="{TemplateBinding ContentTemplate}"
|
||||
CornerRadius="{TemplateBinding CornerRadius}" />
|
||||
<ContentPresenter Name="PART_ContentPresenter"
|
||||
Padding="{TemplateBinding Padding}"
|
||||
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
|
||||
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
|
||||
Background="{TemplateBinding Background}"
|
||||
BorderBrush="{TemplateBinding BorderBrush}"
|
||||
BorderThickness="{TemplateBinding BorderThickness}"
|
||||
Content="{TemplateBinding Content}"
|
||||
ContentTemplate="{TemplateBinding ContentTemplate}"
|
||||
CornerRadius="{TemplateBinding CornerRadius}" />
|
||||
</ControlTemplate>
|
||||
</Setter>
|
||||
</ControlTheme>
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
<ResourceDictionary xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
<ControlTheme x:Key="{x:Type ItemsControl}"
|
||||
TargetType="ItemsControl">
|
||||
<Setter Property="Template">
|
||||
<ControlTemplate TargetType="ItemsControl">
|
||||
<Border Padding="{TemplateBinding Padding}"
|
||||
Background="{TemplateBinding Background}"
|
||||
BorderBrush="{TemplateBinding BorderBrush}"
|
||||
BorderThickness="{TemplateBinding BorderThickness}"
|
||||
CornerRadius="{TemplateBinding CornerRadius}">
|
||||
<ItemsPresenter Name="PART_ItemsPresenter"
|
||||
ItemsPanel="{TemplateBinding ItemsPanel}" />
|
||||
</Border>
|
||||
</ControlTemplate>
|
||||
</Setter>
|
||||
</ControlTheme>
|
||||
</ResourceDictionary>
|
||||
@@ -0,0 +1,43 @@
|
||||
<ResourceDictionary xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
<ControlTheme x:Key="{x:Type ListBox}"
|
||||
TargetType="ListBox">
|
||||
<Setter Property="Background"
|
||||
Value="{DynamicResource RegionBrush}" />
|
||||
<Setter Property="BorderBrush"
|
||||
Value="{DynamicResource BorderBrush}" />
|
||||
<Setter Property="BorderThickness"
|
||||
Value="1" />
|
||||
<Setter Property="Padding"
|
||||
Value="4" />
|
||||
<Setter Property="ScrollViewer.HorizontalScrollBarVisibility"
|
||||
Value="Auto" />
|
||||
<Setter Property="ScrollViewer.VerticalScrollBarVisibility"
|
||||
Value="Auto" />
|
||||
<Setter Property="ScrollViewer.IsScrollChainingEnabled"
|
||||
Value="True" />
|
||||
<Setter Property="Template">
|
||||
<ControlTemplate>
|
||||
<Border Name="border"
|
||||
BorderBrush="{TemplateBinding BorderBrush}"
|
||||
BorderThickness="{TemplateBinding BorderThickness}"
|
||||
CornerRadius="{TemplateBinding CornerRadius}">
|
||||
<ScrollViewer Name="PART_ScrollViewer"
|
||||
AllowAutoHide="{TemplateBinding (ScrollViewer.AllowAutoHide)}"
|
||||
BringIntoViewOnFocusChange="{TemplateBinding (ScrollViewer.BringIntoViewOnFocusChange)}"
|
||||
Background="{TemplateBinding Background}"
|
||||
HorizontalScrollBarVisibility="{TemplateBinding (ScrollViewer.HorizontalScrollBarVisibility)}"
|
||||
IsScrollChainingEnabled="{TemplateBinding (ScrollViewer.IsScrollChainingEnabled)}"
|
||||
IsDeferredScrollingEnabled="{TemplateBinding (ScrollViewer.IsDeferredScrollingEnabled)}"
|
||||
VerticalScrollBarVisibility="{TemplateBinding (ScrollViewer.VerticalScrollBarVisibility)}"
|
||||
VerticalSnapPointsType="{TemplateBinding (ScrollViewer.VerticalSnapPointsType)}"
|
||||
HorizontalSnapPointsType="{TemplateBinding (ScrollViewer.HorizontalSnapPointsType)}">
|
||||
<ItemsPresenter Name="PART_ItemsPresenter"
|
||||
Margin="{TemplateBinding Padding}"
|
||||
ItemsPanel="{TemplateBinding ItemsPanel}" />
|
||||
</ScrollViewer>
|
||||
</Border>
|
||||
</ControlTemplate>
|
||||
</Setter>
|
||||
</ControlTheme>
|
||||
</ResourceDictionary>
|
||||
@@ -0,0 +1,59 @@
|
||||
<ResourceDictionary xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
<ControlTheme x:Key="{x:Type ListBoxItem}"
|
||||
TargetType="ListBoxItem">
|
||||
<Setter Property="Padding"
|
||||
Value="10,0" />
|
||||
<Setter Property="MinHeight"
|
||||
Value="{StaticResource DefaultControlHeight}" />
|
||||
<Setter Property="VerticalContentAlignment"
|
||||
Value="Center" />
|
||||
<Setter Property="Background"
|
||||
Value="{DynamicResource RegionBrush}" />
|
||||
<Setter Property="BorderBrush"
|
||||
Value="Transparent" />
|
||||
<Setter Property="BorderThickness"
|
||||
Value="0" />
|
||||
<Setter Property="Margin"
|
||||
Value="0,0,0,2" />
|
||||
<Setter Property="Template">
|
||||
<ControlTemplate>
|
||||
<ContentPresenter Name="PART_ContentPresenter"
|
||||
Padding="{TemplateBinding Padding}"
|
||||
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
|
||||
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
|
||||
Background="{TemplateBinding Background}"
|
||||
BorderBrush="{TemplateBinding BorderBrush}"
|
||||
BorderThickness="{TemplateBinding BorderThickness}"
|
||||
Content="{TemplateBinding Content}"
|
||||
ContentTemplate="{TemplateBinding ContentTemplate}"
|
||||
CornerRadius="{TemplateBinding CornerRadius}" />
|
||||
</ControlTemplate>
|
||||
</Setter>
|
||||
|
||||
<Style Selector="^:pointerover /template/ ContentPresenter">
|
||||
<Setter Property="Background"
|
||||
Value="{DynamicResource ThemeControlHighlightMidBrush}" />
|
||||
</Style>
|
||||
|
||||
<Style Selector="^:selected /template/ ContentPresenter">
|
||||
<Setter Property="Background"
|
||||
Value="{DynamicResource ThemeAccentBrush4}" />
|
||||
</Style>
|
||||
|
||||
<Style Selector="^:selected:focus /template/ ContentPresenter">
|
||||
<Setter Property="Background"
|
||||
Value="{DynamicResource ThemeAccentBrush3}" />
|
||||
</Style>
|
||||
|
||||
<Style Selector="^:selected:pointerover /template/ ContentPresenter">
|
||||
<Setter Property="Background"
|
||||
Value="{DynamicResource ThemeAccentBrush3}" />
|
||||
</Style>
|
||||
|
||||
<Style Selector="^:selected:focus:pointerover /template/ ContentPresenter">
|
||||
<Setter Property="Background"
|
||||
Value="{DynamicResource ThemeAccentBrush2}" />
|
||||
</Style>
|
||||
</ControlTheme>
|
||||
</ResourceDictionary>
|
||||
@@ -0,0 +1,173 @@
|
||||
<ResourceDictionary xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
<ControlTheme x:Key="{x:Type ScrollBar}"
|
||||
TargetType="ScrollBar">
|
||||
<Setter Property="Cursor"
|
||||
Value="Arrow" />
|
||||
|
||||
<Style Selector="^:horizontal">
|
||||
<Setter Property="Height"
|
||||
Value="{DynamicResource ScrollBarThickness}" />
|
||||
<Setter Property="Template">
|
||||
<ControlTemplate>
|
||||
<Border Background="{DynamicResource ThemeControlMidBrush}"
|
||||
UseLayoutRounding="False">
|
||||
<Grid ColumnDefinitions="Auto,*,Auto"
|
||||
RowDefinitions="*,*,*">
|
||||
<RepeatButton Name="PART_LineUpButton"
|
||||
Grid.Row="0"
|
||||
Grid.Column="0"
|
||||
MinWidth="{DynamicResource ScrollBarThickness}"
|
||||
VerticalAlignment="Center"
|
||||
Classes="repeat"
|
||||
Focusable="False">
|
||||
<Path Data="M 4 0 L 4 8 L 0 4 Z" />
|
||||
</RepeatButton>
|
||||
<Track Grid.Row="1"
|
||||
Grid.Column="1"
|
||||
Maximum="{TemplateBinding Maximum}"
|
||||
Minimum="{TemplateBinding Minimum}"
|
||||
Orientation="{TemplateBinding Orientation}"
|
||||
ViewportSize="{TemplateBinding ViewportSize}"
|
||||
DeferThumbDrag="{TemplateBinding ScrollViewer.IsDeferredScrollingEnabled}"
|
||||
Value="{TemplateBinding Value,
|
||||
Mode=TwoWay}">
|
||||
<Track.DecreaseButton>
|
||||
<RepeatButton Name="PART_PageUpButton"
|
||||
Classes="repeattrack"
|
||||
Focusable="False" />
|
||||
</Track.DecreaseButton>
|
||||
<Track.IncreaseButton>
|
||||
<RepeatButton Name="PART_PageDownButton"
|
||||
Classes="repeattrack"
|
||||
Focusable="False" />
|
||||
</Track.IncreaseButton>
|
||||
<Thumb Name="thumb" />
|
||||
</Track>
|
||||
<RepeatButton Name="PART_LineDownButton"
|
||||
Grid.Row="2"
|
||||
Grid.Column="2"
|
||||
MinWidth="{DynamicResource ScrollBarThickness}"
|
||||
VerticalAlignment="Center"
|
||||
Classes="repeat"
|
||||
Focusable="False">
|
||||
<Path Data="M 0 0 L 4 4 L 0 8 Z" />
|
||||
</RepeatButton>
|
||||
</Grid>
|
||||
</Border>
|
||||
</ControlTemplate>
|
||||
</Setter>
|
||||
</Style>
|
||||
<Style Selector="^:vertical">
|
||||
<Setter Property="Width"
|
||||
Value="{DynamicResource ScrollBarThickness}" />
|
||||
<Setter Property="Template">
|
||||
<ControlTemplate>
|
||||
<Border Background="{DynamicResource ThemeControlMidBrush}"
|
||||
UseLayoutRounding="False">
|
||||
<Grid RowDefinitions="Auto,*,Auto">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition />
|
||||
<ColumnDefinition />
|
||||
<ColumnDefinition />
|
||||
</Grid.ColumnDefinitions>
|
||||
<RepeatButton Name="PART_LineUpButton"
|
||||
Grid.Row="0"
|
||||
MinHeight="{DynamicResource ScrollBarThickness}"
|
||||
HorizontalAlignment="Center"
|
||||
Classes="repeat"
|
||||
Focusable="False">
|
||||
<Path Data="M 0 4 L 8 4 L 4 0 Z" />
|
||||
</RepeatButton>
|
||||
<Track Grid.Row="1"
|
||||
Grid.Column="1"
|
||||
IsDirectionReversed="True"
|
||||
Maximum="{TemplateBinding Maximum}"
|
||||
Minimum="{TemplateBinding Minimum}"
|
||||
Orientation="{TemplateBinding Orientation}"
|
||||
ViewportSize="{TemplateBinding ViewportSize}"
|
||||
DeferThumbDrag="{TemplateBinding ScrollViewer.IsDeferredScrollingEnabled}"
|
||||
Value="{TemplateBinding Value,
|
||||
Mode=TwoWay}">
|
||||
<Track.DecreaseButton>
|
||||
<RepeatButton Name="PART_PageUpButton"
|
||||
Classes="repeattrack"
|
||||
Focusable="False" />
|
||||
</Track.DecreaseButton>
|
||||
<Track.IncreaseButton>
|
||||
<RepeatButton Name="PART_PageDownButton"
|
||||
Classes="repeattrack"
|
||||
Focusable="False" />
|
||||
</Track.IncreaseButton>
|
||||
<Thumb Name="thumb" />
|
||||
</Track>
|
||||
<RepeatButton Name="PART_LineDownButton"
|
||||
Grid.Row="2"
|
||||
Grid.Column="2"
|
||||
MinHeight="{DynamicResource ScrollBarThickness}"
|
||||
HorizontalAlignment="Center"
|
||||
Classes="repeat"
|
||||
Focusable="False">
|
||||
<Path Data="M 0 0 L 4 4 L 8 0 Z" />
|
||||
</RepeatButton>
|
||||
</Grid>
|
||||
</Border>
|
||||
</ControlTemplate>
|
||||
</Setter>
|
||||
</Style>
|
||||
<Style Selector="^ /template/ Thumb#thumb">
|
||||
<Setter Property="Background"
|
||||
Value="{DynamicResource ThemeControlMidHighBrush}" />
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate>
|
||||
<Border Background="{TemplateBinding Background}" />
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
<Style Selector="^ /template/ Thumb#thumb:pointerover">
|
||||
<Setter Property="Background"
|
||||
Value="{DynamicResource ThemeControlHighBrush}" />
|
||||
</Style>
|
||||
<Style Selector="^ /template/ Thumb#thumb:pressed">
|
||||
<Setter Property="Background"
|
||||
Value="{DynamicResource ThemeControlVeryHighBrush}" />
|
||||
</Style>
|
||||
<Style Selector="^:horizontal /template/ Thumb#thumb">
|
||||
<Setter Property="MinWidth"
|
||||
Value="{DynamicResource ScrollBarThickness}" />
|
||||
<Setter Property="Height"
|
||||
Value="{DynamicResource ScrollBarThumbThickness}" />
|
||||
</Style>
|
||||
<Style Selector="^:vertical /template/ Thumb#thumb">
|
||||
<Setter Property="MinHeight"
|
||||
Value="{DynamicResource ScrollBarThickness}" />
|
||||
<Setter Property="Width"
|
||||
Value="{DynamicResource ScrollBarThumbThickness}" />
|
||||
</Style>
|
||||
<Style Selector="^ /template/ RepeatButton.repeat">
|
||||
<Setter Property="Padding"
|
||||
Value="2" />
|
||||
<Setter Property="BorderThickness"
|
||||
Value="0" />
|
||||
</Style>
|
||||
<Style Selector="^ /template/ RepeatButton.repeattrack">
|
||||
<Setter Property="Template">
|
||||
<ControlTemplate>
|
||||
<Border Background="{TemplateBinding Background}" />
|
||||
</ControlTemplate>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
<Style Selector="^ /template/ RepeatButton > Path">
|
||||
<Setter Property="Fill"
|
||||
Value="{DynamicResource ThemeForegroundLowBrush}" />
|
||||
</Style>
|
||||
|
||||
<Style Selector="^ /template/ RepeatButton:pointerover > Path">
|
||||
<Setter Property="Fill"
|
||||
Value="{DynamicResource ThemeAccentBrush}" />
|
||||
</Style>
|
||||
</ControlTheme>
|
||||
</ResourceDictionary>
|
||||
@@ -0,0 +1,40 @@
|
||||
<ResourceDictionary xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
<ControlTheme x:Key="{x:Type ScrollViewer}"
|
||||
TargetType="ScrollViewer">
|
||||
<Setter Property="Background"
|
||||
Value="Transparent" />
|
||||
<Setter Property="Template">
|
||||
<ControlTemplate>
|
||||
<Grid ColumnDefinitions="*,Auto"
|
||||
RowDefinitions="*,Auto">
|
||||
<ScrollContentPresenter Name="PART_ContentPresenter"
|
||||
Padding="{TemplateBinding Padding}"
|
||||
HorizontalSnapPointsType="{TemplateBinding HorizontalSnapPointsType}"
|
||||
VerticalSnapPointsType="{TemplateBinding VerticalSnapPointsType}"
|
||||
HorizontalSnapPointsAlignment="{TemplateBinding HorizontalSnapPointsAlignment}"
|
||||
VerticalSnapPointsAlignment="{TemplateBinding VerticalSnapPointsAlignment}"
|
||||
Background="{TemplateBinding Background}"
|
||||
ScrollViewer.IsScrollInertiaEnabled="{TemplateBinding IsScrollInertiaEnabled}">
|
||||
<ScrollContentPresenter.GestureRecognizers>
|
||||
<ScrollGestureRecognizer CanHorizontallyScroll="{Binding CanHorizontallyScroll, ElementName=PART_ContentPresenter}"
|
||||
CanVerticallyScroll="{Binding CanVerticallyScroll, ElementName=PART_ContentPresenter}"
|
||||
IsScrollInertiaEnabled="{Binding (ScrollViewer.IsScrollInertiaEnabled), ElementName=PART_ContentPresenter}" />
|
||||
</ScrollContentPresenter.GestureRecognizers>
|
||||
</ScrollContentPresenter>
|
||||
<ScrollBar Name="PART_HorizontalScrollBar"
|
||||
Grid.Row="1"
|
||||
Grid.Column="0"
|
||||
Orientation="Horizontal" />
|
||||
<ScrollBar Name="PART_VerticalScrollBar"
|
||||
Grid.Row="0"
|
||||
Grid.Column="1"
|
||||
Orientation="Vertical" />
|
||||
<Panel Grid.Row="1"
|
||||
Grid.Column="1"
|
||||
Background="{DynamicResource ThemeControlMidBrush}" />
|
||||
</Grid>
|
||||
</ControlTemplate>
|
||||
</Setter>
|
||||
</ControlTheme>
|
||||
</ResourceDictionary>
|
||||
@@ -1,17 +1,27 @@
|
||||
<Styles xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
<Styles.Resources>
|
||||
<Styles.Resources>
|
||||
<ResourceDictionary>
|
||||
<ResourceDictionary.MergedDictionaries>
|
||||
<MergeResourceInclude Source="avares://HandyControl/Themes/Basic/Brushes.axaml" />
|
||||
<MergeResourceInclude Source="avares://HandyControl/Themes/Basic/Converters.axaml" />
|
||||
<MergeResourceInclude Source="avares://HandyControl/Themes/Styles/ContentControl.axaml" />
|
||||
<MergeResourceInclude Source="avares://HandyControl/Themes/Styles/UserControl.axaml" />
|
||||
<MergeResourceInclude Source="avares://HandyControl/Themes/Styles/Window.axaml" />
|
||||
<MergeResourceInclude Source="avares://HandyControl/Themes/Styles/Button.axaml" />
|
||||
<MergeResourceInclude Source="avares://HandyControl/Themes/Styles/Border.axaml" />
|
||||
<MergeResourceInclude Source="avares://HandyControl/Themes/Styles/ItemsControl.axaml" />
|
||||
<MergeResourceInclude Source="avares://HandyControl/Themes/Styles/TabItem.axaml" />
|
||||
<MergeResourceInclude Source="avares://HandyControl/Themes/Styles/TabControl.axaml" />
|
||||
<MergeResourceInclude Source="avares://HandyControl/Themes/Styles/ListBoxItem.axaml" />
|
||||
<MergeResourceInclude Source="avares://HandyControl/Themes/Styles/ListBox.axaml" />
|
||||
<MergeResourceInclude Source="avares://HandyControl/Themes/Styles/ScrollBar.axaml" />
|
||||
<MergeResourceInclude Source="avares://HandyControl/Themes/Styles/ScrollViewer.axaml" />
|
||||
</ResourceDictionary.MergedDictionaries>
|
||||
</ResourceDictionary>
|
||||
</Styles.Resources>
|
||||
<Style Selector=":is(UserControl)">
|
||||
<Setter Property="Theme" Value="{DynamicResource {x:Type UserControl}}" />
|
||||
<Setter Property="Theme"
|
||||
Value="{DynamicResource {x:Type UserControl}}" />
|
||||
</Style>
|
||||
</Styles>
|
||||
@@ -0,0 +1,70 @@
|
||||
<ResourceDictionary xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
<ControlTheme x:Key="{x:Type TabControl}"
|
||||
TargetType="TabControl">
|
||||
<Setter Property="Padding"
|
||||
Value="8" />
|
||||
<Setter Property="Template">
|
||||
<ControlTemplate>
|
||||
<Border Padding="{TemplateBinding Padding}"
|
||||
HorizontalAlignment="{TemplateBinding HorizontalAlignment}"
|
||||
VerticalAlignment="{TemplateBinding VerticalAlignment}"
|
||||
Background="{TemplateBinding Background}"
|
||||
BorderBrush="{TemplateBinding BorderBrush}"
|
||||
BorderThickness="{TemplateBinding BorderThickness}"
|
||||
CornerRadius="{TemplateBinding CornerRadius}">
|
||||
<DockPanel>
|
||||
<ItemsPresenter Name="PART_ItemsPresenter"
|
||||
ItemsPanel="{TemplateBinding ItemsPanel}" />
|
||||
<ContentPresenter Name="PART_SelectedContentHost"
|
||||
Margin="{TemplateBinding Padding}"
|
||||
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
|
||||
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
|
||||
Content="{TemplateBinding SelectedContent}"
|
||||
ContentTemplate="{TemplateBinding SelectedContentTemplate}" />
|
||||
</DockPanel>
|
||||
</Border>
|
||||
</ControlTemplate>
|
||||
</Setter>
|
||||
<Style Selector="^[TabStripPlacement=Top]">
|
||||
<Setter Property="Padding"
|
||||
Value="0 4 0 0" />
|
||||
</Style>
|
||||
<Style Selector="^[TabStripPlacement=Top] /template/ ItemsPresenter#PART_ItemsPresenter">
|
||||
<Setter Property="DockPanel.Dock"
|
||||
Value="Top" />
|
||||
</Style>
|
||||
<Style Selector="^[TabStripPlacement=Bottom] /template/ ItemsPresenter#PART_ItemsPresenter">
|
||||
<Setter Property="DockPanel.Dock"
|
||||
Value="Bottom" />
|
||||
</Style>
|
||||
<Style Selector="^[TabStripPlacement=Bottom]">
|
||||
<Setter Property="Padding"
|
||||
Value="0 0 0 4" />
|
||||
</Style>
|
||||
<Style Selector="^[TabStripPlacement=Left] /template/ ItemsPresenter#PART_ItemsPresenter">
|
||||
<Setter Property="DockPanel.Dock"
|
||||
Value="Left" />
|
||||
</Style>
|
||||
<Style Selector="^[TabStripPlacement=Left] /template/ ItemsPresenter#PART_ItemsPresenter > WrapPanel">
|
||||
<Setter Property="Orientation"
|
||||
Value="Vertical" />
|
||||
</Style>
|
||||
<Style Selector="^[TabStripPlacement=Left]">
|
||||
<Setter Property="Padding"
|
||||
Value="4 0 0 0" />
|
||||
</Style>
|
||||
<Style Selector="^[TabStripPlacement=Right] /template/ ItemsPresenter#PART_ItemsPresenter">
|
||||
<Setter Property="DockPanel.Dock"
|
||||
Value="Right" />
|
||||
</Style>
|
||||
<Style Selector="^[TabStripPlacement=Right] /template/ ItemsPresenter#PART_ItemsPresenter > WrapPanel">
|
||||
<Setter Property="Orientation"
|
||||
Value="Vertical" />
|
||||
</Style>
|
||||
<Style Selector="^[TabStripPlacement=Right]">
|
||||
<Setter Property="Padding"
|
||||
Value="0 0 4 0" />
|
||||
</Style>
|
||||
</ControlTheme>
|
||||
</ResourceDictionary>
|
||||
@@ -0,0 +1,45 @@
|
||||
<ResourceDictionary xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
<ControlTheme x:Key="{x:Type TabItem}"
|
||||
TargetType="TabItem">
|
||||
<Setter Property="Foreground"
|
||||
Value="{DynamicResource PrimaryTextBrush}" />
|
||||
<Setter Property="Background"
|
||||
Value="{DynamicResource RegionBrush}" />
|
||||
<Setter Property="BorderBrush"
|
||||
Value="{DynamicResource TitleBrush}" />
|
||||
<Setter Property="Margin"
|
||||
Value="0" />
|
||||
<Setter Property="Padding"
|
||||
Value="{StaticResource DefaultControlPadding}" />
|
||||
<Setter Property="MinHeight"
|
||||
Value="{StaticResource DefaultControlHeight}" />
|
||||
<Setter Property="HorizontalContentAlignment"
|
||||
Value="Stretch" />
|
||||
<Setter Property="VerticalContentAlignment"
|
||||
Value="Stretch" />
|
||||
<Setter Property="Template">
|
||||
<ControlTemplate TargetType="TabItem">
|
||||
<Border Name="PART_LayoutRoot"
|
||||
Background="{TemplateBinding Background}"
|
||||
BorderBrush="{TemplateBinding BorderBrush}"
|
||||
BorderThickness="{TemplateBinding BorderThickness}"
|
||||
CornerRadius="{TemplateBinding CornerRadius}"
|
||||
Padding="{TemplateBinding Padding}">
|
||||
<Panel>
|
||||
<ContentPresenter Name="PART_ContentPresenter"
|
||||
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
|
||||
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
|
||||
Content="{TemplateBinding Header}"
|
||||
ContentTemplate="{TemplateBinding HeaderTemplate}"
|
||||
RecognizesAccessKey="True" />
|
||||
<Border Name="PART_SelectedPipe"
|
||||
Background="{DynamicResource TabItemHeaderSelectedPipeFill}"
|
||||
CornerRadius="{DynamicResource ControlCornerRadius}"
|
||||
IsVisible="False" />
|
||||
</Panel>
|
||||
</Border>
|
||||
</ControlTemplate>
|
||||
</Setter>
|
||||
</ControlTheme>
|
||||
</ResourceDictionary>
|
||||
@@ -1,19 +1,19 @@
|
||||
<ResourceDictionary xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
<ControlTheme x:Key="{x:Type UserControl}" TargetType="UserControl">
|
||||
<ControlTheme x:Key="{x:Type UserControl}"
|
||||
TargetType="UserControl">
|
||||
<Setter Property="Template">
|
||||
<ControlTemplate TargetType="UserControl">
|
||||
<ContentPresenter
|
||||
Name="PART_ContentPresenter"
|
||||
Padding="{TemplateBinding Padding}"
|
||||
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
|
||||
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
|
||||
Background="{TemplateBinding Background}"
|
||||
BorderBrush="{TemplateBinding BorderBrush}"
|
||||
BorderThickness="{TemplateBinding BorderThickness}"
|
||||
Content="{TemplateBinding Content}"
|
||||
ContentTemplate="{TemplateBinding ContentTemplate}"
|
||||
CornerRadius="{TemplateBinding CornerRadius}" />
|
||||
<ContentPresenter Name="PART_ContentPresenter"
|
||||
Padding="{TemplateBinding Padding}"
|
||||
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
|
||||
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
|
||||
Background="{TemplateBinding Background}"
|
||||
BorderBrush="{TemplateBinding BorderBrush}"
|
||||
BorderThickness="{TemplateBinding BorderThickness}"
|
||||
Content="{TemplateBinding Content}"
|
||||
ContentTemplate="{TemplateBinding ContentTemplate}"
|
||||
CornerRadius="{TemplateBinding CornerRadius}" />
|
||||
</ControlTemplate>
|
||||
</Setter>
|
||||
</ControlTheme>
|
||||
|
||||
@@ -1,31 +1,40 @@
|
||||
<ResourceDictionary xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
x:ClassModifier="internal">
|
||||
<ControlTheme x:Key="{x:Type Window}" TargetType="Window">
|
||||
<Setter Property="Background" Value="{DynamicResource SecondaryRegionBrush}"/>
|
||||
<Setter Property="TransparencyBackgroundFallback" Value="{DynamicResource RegionBrush}" />
|
||||
<Setter Property="TopLevel.SystemBarColor" Value="{DynamicResource RegionBrush}"/>
|
||||
<Setter Property="Foreground" Value="{DynamicResource PrimaryTextBrush}"/>
|
||||
<Setter Property="FontSize" Value="13"/>
|
||||
<Setter Property="Template">
|
||||
<ControlTemplate TargetType="Window">
|
||||
<Panel>
|
||||
<Border Name="PART_TransparencyFallback" IsHitTestVisible="False" />
|
||||
<Border Background="{TemplateBinding Background}" IsHitTestVisible="False" />
|
||||
<Panel Background="Transparent" Margin="{TemplateBinding WindowDecorationMargin}" />
|
||||
<VisualLayerManager>
|
||||
<VisualLayerManager.ChromeOverlayLayer>
|
||||
<TitleBar />
|
||||
</VisualLayerManager.ChromeOverlayLayer>
|
||||
<ContentPresenter Name="PART_ContentPresenter"
|
||||
<ControlTheme x:Key="{x:Type Window}"
|
||||
TargetType="Window">
|
||||
<Setter Property="Background"
|
||||
Value="{DynamicResource SecondaryRegionBrush}" />
|
||||
<Setter Property="TransparencyBackgroundFallback"
|
||||
Value="{DynamicResource RegionBrush}" />
|
||||
<Setter Property="TopLevel.SystemBarColor"
|
||||
Value="{DynamicResource RegionBrush}" />
|
||||
<Setter Property="Foreground"
|
||||
Value="{DynamicResource PrimaryTextBrush}" />
|
||||
<Setter Property="FontSize"
|
||||
Value="13" />
|
||||
<Setter Property="Template">
|
||||
<ControlTemplate TargetType="Window">
|
||||
<Panel>
|
||||
<Border Name="PART_TransparencyFallback"
|
||||
IsHitTestVisible="False" />
|
||||
<Border Background="{TemplateBinding Background}"
|
||||
IsHitTestVisible="False" />
|
||||
<Panel Background="Transparent"
|
||||
Margin="{TemplateBinding WindowDecorationMargin}" />
|
||||
<VisualLayerManager>
|
||||
<VisualLayerManager.ChromeOverlayLayer>
|
||||
<TitleBar />
|
||||
</VisualLayerManager.ChromeOverlayLayer>
|
||||
<ContentPresenter Name="PART_ContentPresenter"
|
||||
ContentTemplate="{TemplateBinding ContentTemplate}"
|
||||
Content="{TemplateBinding Content}"
|
||||
Margin="{TemplateBinding Padding}"
|
||||
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
|
||||
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"/>
|
||||
</VisualLayerManager>
|
||||
</Panel>
|
||||
</ControlTemplate>
|
||||
</Setter>
|
||||
</ControlTheme>
|
||||
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" />
|
||||
</VisualLayerManager>
|
||||
</Panel>
|
||||
</ControlTemplate>
|
||||
</Setter>
|
||||
</ControlTheme>
|
||||
</ResourceDictionary>
|
||||
Reference in new issue
Block a user