1 changed files with 37 additions and 15 deletions
@ -1,38 +1,60 @@ |
|||||
<Styles xmlns="https://github.com/avaloniaui"> |
<Styles xmlns="https://github.com/avaloniaui" |
||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> |
||||
|
<Design.PreviewWith> |
||||
|
<Border Padding="20" |
||||
|
Background="Black"> |
||||
|
<StackPanel Spacing="20"> |
||||
|
<NumericUpDown Minimum="0" |
||||
|
Maximum="10" |
||||
|
Increment="0.5" |
||||
|
Width="150" |
||||
|
Watermark="Enter text" /> |
||||
|
<NumericUpDown Minimum="0" |
||||
|
Maximum="10" |
||||
|
Increment="0.5" |
||||
|
Width="150" |
||||
|
ButtonSpinnerLocation="Left" |
||||
|
Watermark="Enter text" /> |
||||
|
</StackPanel> |
||||
|
</Border> |
||||
|
</Design.PreviewWith> |
||||
|
|
||||
<Style Selector="NumericUpDown"> |
<Style Selector="NumericUpDown"> |
||||
<Setter Property="Background" Value="{DynamicResource ThemeBackgroundBrush}" /> |
<Setter Property="Foreground" Value="{DynamicResource TextControlForeground}" /> |
||||
<Setter Property="BorderBrush" Value="{DynamicResource ThemeBorderMidBrush}"/> |
<Setter Property="Background" Value="{DynamicResource TextControlBackground}" /> |
||||
<Setter Property="BorderThickness" Value="{DynamicResource ThemeBorderThickness}"/> |
<Setter Property="BorderThickness" Value="{DynamicResource TextControlBorderThemeThickness}" /> |
||||
<Setter Property="Padding" Value="4"/> |
<Setter Property="BorderBrush" Value="{DynamicResource TextControlBorderBrush}" /> |
||||
|
<Setter Property="MinHeight" Value="{DynamicResource TextControlThemeMinHeight}" /> |
||||
|
<Setter Property="MinWidth" Value="{DynamicResource TextControlThemeMinWidth}" /> |
||||
|
<Setter Property="FontFamily" Value="{DynamicResource ContentControlThemeFontFamily}" /> |
||||
|
<Setter Property="FontSize" Value="{DynamicResource ControlContentThemeFontSize}" /> |
||||
|
<Setter Property="Padding" Value="{DynamicResource TextControlThemePadding}" /> |
||||
<Setter Property="Template"> |
<Setter Property="Template"> |
||||
<ControlTemplate> |
<ControlTemplate> |
||||
<ButtonSpinner Name="PART_Spinner" |
<ButtonSpinner Name="PART_Spinner" |
||||
Background="{TemplateBinding Background}" |
Background="{TemplateBinding Background}" |
||||
BorderThickness="{TemplateBinding BorderThickness}" |
BorderThickness="{TemplateBinding BorderThickness}" |
||||
BorderBrush="{TemplateBinding BorderBrush}" |
BorderBrush="{TemplateBinding BorderBrush}" |
||||
|
Padding="0" |
||||
HorizontalContentAlignment="Stretch" |
HorizontalContentAlignment="Stretch" |
||||
VerticalContentAlignment="Stretch" |
VerticalContentAlignment="Stretch" |
||||
AllowSpin="{TemplateBinding AllowSpin}" |
AllowSpin="{TemplateBinding AllowSpin}" |
||||
ShowButtonSpinner="{TemplateBinding ShowButtonSpinner}" |
ShowButtonSpinner="{TemplateBinding ShowButtonSpinner}" |
||||
ButtonSpinnerLocation="{TemplateBinding ButtonSpinnerLocation}"> |
ButtonSpinnerLocation="{TemplateBinding ButtonSpinnerLocation}"> |
||||
<TextBox Name="PART_TextBox" |
<TextBox Name="PART_TextBox" |
||||
BorderThickness="0" |
Background="Transparent" |
||||
Background="{TemplateBinding Background}" |
BorderBrush="Transparent" |
||||
BorderBrush="{TemplateBinding BorderBrush}" |
Margin="-2" |
||||
Padding="{TemplateBinding Padding}" |
Padding="{TemplateBinding Padding}" |
||||
Watermark="{TemplateBinding Watermark}" |
Watermark="{TemplateBinding Watermark}" |
||||
DataValidationErrors.Errors="{TemplateBinding (DataValidationErrors.Errors)}" |
DataValidationErrors.Errors="{TemplateBinding (DataValidationErrors.Errors)}" |
||||
IsReadOnly="{TemplateBinding IsReadOnly}" |
IsReadOnly="{TemplateBinding IsReadOnly}" |
||||
Text="{TemplateBinding Text}" |
Text="{TemplateBinding Text}" |
||||
AcceptsReturn="False" |
AcceptsReturn="False" |
||||
TextWrapping="NoWrap"> |
TextWrapping="NoWrap" /> |
||||
</TextBox> |
|
||||
</ButtonSpinner> |
</ButtonSpinner> |
||||
</ControlTemplate> |
</ControlTemplate> |
||||
</Setter> |
</Setter> |
||||
</Style> |
</Style> |
||||
<Style Selector="NumericUpDown /template/ TextBox#PART_TextBox"> |
|
||||
<Setter Property="Margin" Value="4"/> |
</Styles> |
||||
<Setter Property="MinWidth" Value="20"/> |
|
||||
</Style> |
|
||||
</Styles> |
|
||||
|
|||||
Loading…
Reference in new issue