<ResourceDictionary
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:primitives="clr-namespace:ModernWpf.Controls.Primitives"
    xmlns:sys="clr-namespace:System;assembly=mscorlib">

    <Thickness x:Key="TimePickerTopHeaderMargin">0,0,0,4</Thickness>
    <sys:Double x:Key="TimePickerFlyoutPresenterHighlightHeight">40</sys:Double>
    <sys:Double x:Key="TimePickerFlyoutPresenterAcceptDismissHostGridHeight">41</sys:Double>
    <sys:Double x:Key="TimePickerThemeMinWidth">242</sys:Double>
    <sys:Double x:Key="TimePickerThemeMaxWidth">456</sys:Double>
    <sys:Double x:Key="TimePickerFlyoutPresenterItemHeight">40</sys:Double>
    <sys:Double x:Key="TimePickerPopupVerticalOffset">18.5</sys:Double>
    <Thickness x:Key="TimePickerFlyoutPresenterItemPadding">0,3,0,6</Thickness>

    <Thickness x:Key="TimePickerHostPadding">0,3,0,6</Thickness>

    <Style x:Key="DateTimePickerFlyoutButtonStyle" TargetType="ButtonBase">
        <Setter Property="Background" Value="{DynamicResource DateTimePickerFlyoutButtonBackground}" />
        <Setter Property="Foreground" Value="{DynamicResource SystemControlForegroundBaseHighBrush}" />
        <Setter Property="HorizontalContentAlignment" Value="Center" />
        <Setter Property="VerticalContentAlignment" Value="Center" />
        <Setter Property="FocusVisualStyle" Value="{DynamicResource {x:Static SystemParameters.FocusVisualStyleKey}}" />
        <Setter Property="primitives:FocusVisualHelper.UseSystemFocusVisuals" Value="{DynamicResource UseSystemFocusVisuals}" />
        <Setter Property="primitives:FocusVisualHelper.FocusVisualMargin" Value="0" />
        <Setter Property="primitives:ControlHelper.CornerRadius" Value="{DynamicResource ControlCornerRadius}" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="ButtonBase">
                    <Grid Background="{TemplateBinding Background}">
                        <Border
                            x:Name="Border"
                            Background="{TemplateBinding Background}"
                            BorderBrush="{DynamicResource DateTimePickerFlyoutButtonBorderBrush}"
                            BorderThickness="{DynamicResource DateTimeFlyoutButtonBorderThickness}"
                            Padding="{TemplateBinding Padding}"
                            CornerRadius="{TemplateBinding primitives:ControlHelper.CornerRadius}">
                            <ContentPresenter
                                x:Name="ContentPresenter"
                                HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />
                        </Border>
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsMouseOver" Value="True">
                            <Setter TargetName="Border" Property="Background" Value="{DynamicResource DateTimePickerFlyoutButtonBackgroundPointerOver}" />
                            <Setter TargetName="Border" Property="BorderBrush" Value="{DynamicResource DateTimePickerFlyoutButtonBorderBrushPointerOver}" />
                            <Setter TargetName="ContentPresenter" Property="TextElement.Foreground" Value="{DynamicResource DateTimePickerFlyoutButtonForegroundPointerOver}" />
                        </Trigger>
                        <Trigger Property="IsPressed" Value="True">
                            <Setter TargetName="Border" Property="Background" Value="{DynamicResource DateTimePickerFlyoutButtonBackgroundPressed}" />
                            <Setter TargetName="Border" Property="BorderBrush" Value="{DynamicResource DateTimePickerFlyoutButtonBorderBrushPressed}" />
                            <Setter TargetName="ContentPresenter" Property="TextElement.Foreground" Value="{DynamicResource DateTimePickerFlyoutButtonForegroundPressed}" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

</ResourceDictionary>