|
| 1 | +<ResourceDictionary xmlns="https://github.com/avaloniaui" |
| 2 | + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
| 3 | + xmlns:hc="clr-namespace:HandyControl.Controls" |
| 4 | + xmlns:system="clr-namespace:System;assembly=System.Runtime"> |
| 5 | + <ControlTheme x:Key="{x:Type ButtonSpinner}" |
| 6 | + TargetType="ButtonSpinner"> |
| 7 | + <Setter Property="hc:BorderElement.CornerRadius" |
| 8 | + Value="{StaticResource DefaultCornerRadius}" /> |
| 9 | + <Setter Property="CornerRadius" |
| 10 | + Value="{Binding $self.(hc:BorderElement.CornerRadius)}" /> |
| 11 | + <Setter Property="MinHeight" |
| 12 | + Value="{StaticResource DefaultControlHeight}" /> |
| 13 | + <Setter Property="Padding" |
| 14 | + Value="{StaticResource DefaultInputPadding}" /> |
| 15 | + <Setter Property="VerticalContentAlignment" |
| 16 | + Value="Center" /> |
| 17 | + <Setter Property="HorizontalContentAlignment" |
| 18 | + Value="Left" /> |
| 19 | + <Setter Property="Background" |
| 20 | + Value="{DynamicResource RegionBrush}" /> |
| 21 | + <Setter Property="BorderBrush" |
| 22 | + Value="{DynamicResource BorderBrush}" /> |
| 23 | + <Setter Property="Foreground" |
| 24 | + Value="{DynamicResource PrimaryTextBrush}" /> |
| 25 | + <Setter Property="BorderThickness" |
| 26 | + Value="1" /> |
| 27 | + <Setter Property="Template"> |
| 28 | + <ControlTemplate> |
| 29 | + <DataValidationErrors> |
| 30 | + <Panel> |
| 31 | + <Border Name="border" |
| 32 | + HorizontalAlignment="{TemplateBinding HorizontalAlignment}" |
| 33 | + VerticalAlignment="{TemplateBinding VerticalAlignment}" |
| 34 | + Background="{TemplateBinding Background}" |
| 35 | + BorderBrush="{TemplateBinding BorderBrush}" |
| 36 | + BorderThickness="{TemplateBinding BorderThickness}" |
| 37 | + CornerRadius="{TemplateBinding CornerRadius}" /> |
| 38 | + <DockPanel> |
| 39 | + <UniformGrid Name="PART_SpinnerPanel" |
| 40 | + TabIndex="2" |
| 41 | + DockPanel.Dock="Right" |
| 42 | + IsVisible="{TemplateBinding ShowButtonSpinner}" |
| 43 | + Rows="2"> |
| 44 | + <RepeatButton Name="PART_IncreaseButton" |
| 45 | + Height="{x:Static system:Double.NaN}" |
| 46 | + Width="{x:Static system:Double.NaN}" |
| 47 | + Foreground="{TemplateBinding BorderBrush}" |
| 48 | + IsTabStop="{TemplateBinding IsTabStop}" |
| 49 | + Theme="{StaticResource RepeatButtonIcon}" |
| 50 | + VerticalContentAlignment="Bottom" |
| 51 | + VerticalAlignment="Stretch" |
| 52 | + Padding="{Binding Padding, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource ThicknessSplitConverter}, ConverterParameter='0,0,1,0'}" |
| 53 | + hc:IconElement.Geometry="{StaticResource UpGeometry}" |
| 54 | + hc:IconElement.Height="6" |
| 55 | + hc:IconElement.Width="{x:Static system:Double.NaN}" /> |
| 56 | + <RepeatButton Name="PART_DecreaseButton" |
| 57 | + Height="{x:Static system:Double.NaN}" |
| 58 | + Width="{x:Static system:Double.NaN}" |
| 59 | + Foreground="{TemplateBinding BorderBrush}" |
| 60 | + IsTabStop="{TemplateBinding IsTabStop}" |
| 61 | + Theme="{StaticResource RepeatButtonIcon}" |
| 62 | + VerticalContentAlignment="Top" |
| 63 | + VerticalAlignment="Stretch" |
| 64 | + Padding="{Binding Padding, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource ThicknessSplitConverter}, ConverterParameter='0,0,1,0'}" |
| 65 | + hc:IconElement.Geometry="{StaticResource DownGeometry}" |
| 66 | + hc:IconElement.Height="6" |
| 67 | + hc:IconElement.Width="{x:Static system:Double.NaN}" /> |
| 68 | + </UniformGrid> |
| 69 | + <ContentPresenter Name="PART_ContentPresenter" |
| 70 | + TabIndex="1" |
| 71 | + Padding="{TemplateBinding Padding}" |
| 72 | + HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" |
| 73 | + VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" |
| 74 | + Content="{TemplateBinding Content}" |
| 75 | + ContentTemplate="{TemplateBinding ContentTemplate}" /> |
| 76 | + </DockPanel> |
| 77 | + </Panel> |
| 78 | + </DataValidationErrors> |
| 79 | + </ControlTemplate> |
| 80 | + </Setter> |
| 81 | + |
| 82 | + <Style Selector="^:left"> |
| 83 | + <Setter Property="HorizontalContentAlignment" |
| 84 | + Value="Right" /> |
| 85 | + <Setter Property="Template"> |
| 86 | + <ControlTemplate> |
| 87 | + <DataValidationErrors> |
| 88 | + <Panel> |
| 89 | + <Border Name="border" |
| 90 | + HorizontalAlignment="{TemplateBinding HorizontalAlignment}" |
| 91 | + VerticalAlignment="{TemplateBinding VerticalAlignment}" |
| 92 | + Background="{TemplateBinding Background}" |
| 93 | + BorderBrush="{TemplateBinding BorderBrush}" |
| 94 | + BorderThickness="{TemplateBinding BorderThickness}" |
| 95 | + CornerRadius="{TemplateBinding CornerRadius}" /> |
| 96 | + <DockPanel> |
| 97 | + <UniformGrid Name="PART_SpinnerPanel" |
| 98 | + TabIndex="2" |
| 99 | + DockPanel.Dock="Left" |
| 100 | + IsVisible="{TemplateBinding ShowButtonSpinner}" |
| 101 | + Rows="2"> |
| 102 | + <RepeatButton Name="PART_IncreaseButton" |
| 103 | + Height="{x:Static system:Double.NaN}" |
| 104 | + Width="{x:Static system:Double.NaN}" |
| 105 | + Foreground="{TemplateBinding BorderBrush}" |
| 106 | + IsTabStop="{TemplateBinding IsTabStop}" |
| 107 | + Theme="{StaticResource RepeatButtonIcon}" |
| 108 | + VerticalContentAlignment="Bottom" |
| 109 | + VerticalAlignment="Stretch" |
| 110 | + Padding="{Binding Padding, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource ThicknessSplitConverter}, ConverterParameter='1,0,0,0'}" |
| 111 | + hc:IconElement.Geometry="{StaticResource UpGeometry}" |
| 112 | + hc:IconElement.Height="6" |
| 113 | + hc:IconElement.Width="{x:Static system:Double.NaN}" /> |
| 114 | + <RepeatButton Name="PART_DecreaseButton" |
| 115 | + Height="{x:Static system:Double.NaN}" |
| 116 | + Width="{x:Static system:Double.NaN}" |
| 117 | + Foreground="{TemplateBinding BorderBrush}" |
| 118 | + IsTabStop="{TemplateBinding IsTabStop}" |
| 119 | + Theme="{StaticResource RepeatButtonIcon}" |
| 120 | + VerticalContentAlignment="Top" |
| 121 | + VerticalAlignment="Stretch" |
| 122 | + Padding="{Binding Padding, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource ThicknessSplitConverter}, ConverterParameter='1,0,0,0'}" |
| 123 | + hc:IconElement.Geometry="{StaticResource DownGeometry}" |
| 124 | + hc:IconElement.Height="6" |
| 125 | + hc:IconElement.Width="{x:Static system:Double.NaN}" /> |
| 126 | + </UniformGrid> |
| 127 | + <ContentPresenter Name="PART_ContentPresenter" |
| 128 | + TabIndex="1" |
| 129 | + Padding="{TemplateBinding Padding}" |
| 130 | + HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" |
| 131 | + VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" |
| 132 | + Content="{TemplateBinding Content}" |
| 133 | + ContentTemplate="{TemplateBinding ContentTemplate}" /> |
| 134 | + </DockPanel> |
| 135 | + </Panel> |
| 136 | + </DataValidationErrors> |
| 137 | + </ControlTemplate> |
| 138 | + </Setter> |
| 139 | + </Style> |
| 140 | + </ControlTheme> |
| 141 | +</ResourceDictionary> |
0 commit comments