<ResourceDictionary
    xmlns="https://github.com/avaloniaui"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    x:CompileBindings="True">
    <!--  Add Resources Here  -->
    <ControlTheme x:Key="{x:Type NumericUpDown}" TargetType="NumericUpDown">
        <Setter Property="NumericUpDown.VerticalAlignment" Value="Center" />
        <Setter Property="NumericUpDown.VerticalContentAlignment" Value="Center" />
        <Setter Property="NumericUpDown.CornerRadius" Value="{DynamicResource NumericUpDownCornerRadius}" />
        <Setter Property="NumericUpDown.MinHeight" Value="{DynamicResource NumericUpDownDefaultHeight}" />
        <Setter Property="NumericUpDown.Template">
            <ControlTemplate TargetType="NumericUpDown">
                <DataValidationErrors>
                    <ButtonSpinner
                        Name="PART_Spinner"
                        MinWidth="0"
                        HorizontalContentAlignment="Stretch"
                        VerticalContentAlignment="Stretch"
                        AllowSpin="{TemplateBinding AllowSpin}"
                        Background="{TemplateBinding Background}"
                        BorderBrush="{TemplateBinding BorderBrush}"
                        BorderThickness="{TemplateBinding BorderThickness}"
                        ButtonSpinnerLocation="{TemplateBinding ButtonSpinnerLocation}"
                        ShowButtonSpinner="{TemplateBinding ShowButtonSpinner}">
                        <TextBox
                            Name="PART_TextBox"
                            Height="{TemplateBinding Height}"
                            MinHeight="{TemplateBinding MinHeight}"
                            VerticalAlignment="Stretch"
                            HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
                            VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
                            AcceptsReturn="False"
                            CornerRadius="{TemplateBinding CornerRadius}"
                            DataValidationErrors.Errors="{Binding $parent[NumericUpDown].(DataValidationErrors.Errors)}"
                            FontSize="{TemplateBinding FontSize}"
                            Foreground="{TemplateBinding Foreground}"
                            IsReadOnly="{TemplateBinding IsReadOnly}"
                            Text="{TemplateBinding Text}"
                            TextWrapping="NoWrap"
                            Theme="{DynamicResource NonErrorTextBox}"
                            InnerLeftContent="{TemplateBinding InnerLeftContent}"
                            InnerRightContent="{TemplateBinding InnerRightContent}"
                            Watermark="{TemplateBinding Watermark}" />
                    </ButtonSpinner>
                </DataValidationErrors>
            </ControlTemplate>
        </Setter>

        <Style Selector="^.Large">
            <Setter Property="MinHeight" Value="{DynamicResource NumericUpDownLargeHeight}" />
        </Style>
        <Style Selector="^.Small">
            <Setter Property="MinHeight" Value="{DynamicResource NumericUpDownSmallHeight}" />
        </Style>

        <Style Selector="^:error">
            <Style Selector="^ /template/ TextBox#PART_TextBox">
                <Setter Property="Background" Value="{DynamicResource DataValidationErrorsBackground}" />
                <Setter Property="BorderBrush" Value="Transparent" />
            </Style>
            <Style Selector="^:pointerover /template/ TextBox#PART_TextBox">
                <Setter Property="Background" Value="{DynamicResource DataValidationErrorsPointerOverBackground}" />
                <Setter Property="BorderBrush" Value="Transparent" />
            </Style>
            <Style Selector="^:pressed /template/ TextBox#PART_TextBox">
                <Setter Property="Background" Value="{DynamicResource DataValidationErrorsPressedBackground}" />
                <Setter Property="BorderBrush" Value="Transparent" />
            </Style>
            <Style Selector="^:focus /template/ TextBox#PART_TextBox">
                <Setter Property="Background" Value="{DynamicResource DataValidationErrorsSelectedBackground}" />
                <Setter Property="BorderBrush" Value="{DynamicResource DataValidationErrorsSelectedBorderBrush}" />
            </Style>
        </Style>
    </ControlTheme>

</ResourceDictionary>