<ResourceDictionary
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:primitives="using:Telerik.UI.Xaml.Controls.Primitives.LoopingList"
    xmlns:input="using:Telerik.UI.Xaml.Controls.Input"
    xmlns:inputDateTime="using:Telerik.UI.Xaml.Controls.Input.DateTimePickers"
    xmlns:inputTheming="using:Telerik.UI.Xaml.Controls.Input.Theming">
    
    <inputTheming:PaletteInitializer x:Key="PaletteInitializer"/>
    
    <Style TargetType="inputDateTime:DateTimeListItem">
        <Setter Property="IsTabStop" Value="False"/>
        <Setter Property="IsHitTestVisible" Value="False"/>
        <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
        <Setter Property="VerticalContentAlignment" Value="Stretch"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="inputDateTime:DateTimeListItem">
                    <Grid x:Name="root" Margin="{TemplateBinding Padding}">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualStateGroup.Transitions>
                                    <VisualTransition GeneratedDuration="0:0:0.1"/>
                                </VisualStateGroup.Transitions>

                                <VisualState x:Name="Collapsed">
                                    <Storyboard>
                                        <DoubleAnimation To="0" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="root" Duration="0"/>
                                    </Storyboard>
                                </VisualState>

                                <VisualState x:Name="Expanded">
                                    <Storyboard Duration="0">
                                        <DoubleAnimation To="1" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="root" Duration="0"/>
                                    </Storyboard>
                                </VisualState>

                                <VisualState x:Name="Selected">
                                    <Storyboard Duration="0">
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="fill" Storyboard.TargetProperty="Fill">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource TelerikDateTimePickerSelectorItemSelectedBackgroundBrush}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="contentPresenter" Storyboard.TargetProperty="Foreground">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource TelerikDateTimePickerSelectorItemSelectedForegroundBrush}" />
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>

                                <VisualState x:Name="Disabled">
                                    <Storyboard Duration="0">
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="fill" Storyboard.TargetProperty="Fill">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource TelerikDateTimePickerSelectorItemDisabledBackgroundBrush}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="contentPresenter" Storyboard.TargetProperty="Foreground">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource TelerikDateTimePickerSelectorItemDisabledForegroundBrush}" />
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>

                            <VisualStateGroup x:Name="FocusedStates">
                                <VisualState x:Name="NotFocused"/>
                                <VisualState x:Name="Focused">
                                    <Storyboard Duration="0">
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="focusRect" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="Visible"/>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        
                        <Rectangle x:Name="fill" Fill="{StaticResource TelerikDateTimePickerSelectorItemBackgroundBrush}" Margin="1"/>
                        <ContentControl x:Name="contentPresenter" Content="{TemplateBinding Content}" 
                                        ContentTemplate="{TemplateBinding ContentTemplate}" IsTabStop="False"
                                        VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" 
                                        HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
                                        Foreground="{StaticResource TelerikDateTimePickerSelectorItemForegroundBrush}" Margin="1">
                        </ContentControl>
                        <Rectangle Stroke="{StaticResource TelerikDateTimePickerSelectorForegroundBrush}" StrokeDashOffset=".5"
                                   StrokeThickness="1" StrokeDashArray="1 1" x:Name="focusRect" Visibility="Collapsed"/>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    
    <Style TargetType="inputDateTime:DateTimeList">
        <Setter Property="ItemSpacing" Value="5"/>
        <Setter Property="IsTabStop" Value="True"/>
        <Setter Property="IsCentered" Value="True"/>
        <Setter Property="HorizontalAlignment" Value="Center"/>
        <Setter Property="Background" Value="Transparent"/>
        <Setter Property="ItemTemplate">
            <Setter.Value>
                <DataTemplate>
                    <Grid VerticalAlignment="Stretch">
                        <TextBlock Text="{Binding HeaderText}" FontFamily="Segoe UI Semilight" FontSize="26.667" Margin="5,0,0,16" VerticalAlignment="Bottom"/>
                        <TextBlock Text="{Binding ContentText}" Opacity=".6" FontFamily="Segoe UI" FontSize="12" Margin="5,0,0,4" VerticalAlignment="Bottom"/>
                    </Grid>
                </DataTemplate>
            </Setter.Value>
        </Setter>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="inputDateTime:DateTimeList">
                    <Border Background="{TemplateBinding Background}">
                        <primitives:LoopingPanel x:Name="PART_Panel"/>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    
    <Style TargetType="Button" x:Key="SelectorButtonStyle">
        <Setter Property="Background" Value="{StaticResource TelerikDateTimePickerSelectorButtonBackgroundBrush}" />
        <Setter Property="Foreground" Value="{StaticResource TelerikDateTimePickerSelectorButtonForegroundBrush}"/>
        <Setter Property="BorderBrush" Value="{StaticResource TelerikDateTimePickerSelectorButtonBorderBrush}"/>
        <Setter Property="BorderThickness" Value="2"/>
        <Setter Property="Padding" Value="-1,-1,0,0" />
        <Setter Property="Margin" Value="5" />
        <Setter Property="HorizontalAlignment" Value="Left" />
        <Setter Property="VerticalAlignment" Value="Center" />
        <Setter Property="FontFamily" Value="Segoe UI Symbol" />
        <Setter Property="FontSize" Value="{StaticResource ControlContentThemeFontSize}" />
        <Setter Property="FontWeight" Value="Normal"/>
        <Setter Property="Width" Value="40"/>
        <Setter Property="Height" Value="40"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="Button">
                    <Grid>
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal"/>
                                <VisualState x:Name="PointerOver">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Ellipse" Storyboard.TargetProperty="Fill">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource TelerikDateTimePickerSelectorButtonPointerOverBackgroundBrush}"/>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Pressed">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Ellipse" Storyboard.TargetProperty="Fill">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource TelerikDateTimePickerSelectorButtonPressedBackgroundBrush}"/>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="Foreground">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource TelerikDateTimePickerSelectorButtonPressedForegroundBrush}"/>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="FocusStates">
                                <VisualState x:Name="Focused">
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetName="FocusEllipse" Storyboard.TargetProperty="Opacity">
                                            <DiscreteDoubleKeyFrame KeyTime="0" Value="1"/>
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Unfocused" />
                                <VisualState x:Name="PointerFocused" />
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Ellipse HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Fill="{TemplateBinding Background}"
                                 Stroke="{TemplateBinding BorderBrush}" StrokeThickness="2" x:Name="Ellipse" Margin="3"/>
                        <Ellipse HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Opacity="0" StrokeDashArray="1 1"
                                 Stroke="{TemplateBinding BorderBrush}" StrokeThickness="1" x:Name="FocusEllipse"/>
                        <ContentPresenter x:Name="ContentPresenter"
                                              Content="{TemplateBinding Content}"
                                              ContentTransitions="{TemplateBinding ContentTransitions}"
                                              ContentTemplate="{TemplateBinding ContentTemplate}"
                                              Margin="{TemplateBinding Padding}"
                                              HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                              VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    
    <Style TargetType="inputDateTime:DateTimePickerButton">
        <Setter Property="HorizontalAlignment" Value="Stretch"/>
        <Setter Property="VerticalAlignment" Value="Stretch"/>
        <Setter Property="Foreground" Value="{StaticResource TelerikDateTimePickerForegroundBrush}"/>
        <Setter Property="Background" Value="{StaticResource TelerikDateTimePickerBackgroundBrush}"/>
        <Setter Property="Padding" Value="8,0,8,0"/>
        <Setter Property="BorderBrush" Value="{StaticResource TelerikDateTimePickerBorderBrush}"/>
        <Setter Property="BorderThickness" Value="2"/>
        <Setter Property="FontFamily" Value="{StaticResource ContentControlThemeFontFamily}" />
        <Setter Property="FontSize" Value="{StaticResource ControlContentThemeFontSize}" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="inputDateTime:DateTimePickerButton">
                    <Grid>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="*"/>
                            <ColumnDefinition Width="32"/>
                        </Grid.ColumnDefinitions>
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal" />
                                <VisualState x:Name="PointerOver">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Background" Storyboard.TargetProperty="Background">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource TelerikDateTimePickerPointerOverBackgroundBrush}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Background" Storyboard.TargetProperty="BorderBrush">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource TelerikDateTimePickerPointerOverBorderBrush}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Item" Storyboard.TargetProperty="Fill">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource TelerikDateTimePickerItemPointerOverBackgroundBrush}" />
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Pressed">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Background" Storyboard.TargetProperty="Background">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource TelerikDateTimePickerPressedBackgroundBrush}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Background" Storyboard.TargetProperty="BorderBrush">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource TelerikDateTimePickerPressedBorderBrush}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Item" Storyboard.TargetProperty="Fill">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource TelerikDateTimePickerItemPressedBackgroundBrush}" />
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Background" Storyboard.TargetProperty="Background">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource TelerikDateTimePickerDisabledBackgroundBrush}"/>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Background" Storyboard.TargetProperty="BorderBrush">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource TelerikDateTimePickerDisabledBorderBrush}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="Foreground">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource TelerikDateTimePickerDisabledForegroundBrush}"/>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="DropDownGlyph" Storyboard.TargetProperty="Foreground">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource TelerikDateTimePickerDisabledForegroundBrush}"/>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="FocusStates">
                                <VisualState x:Name="Unfocused"/>
                                <VisualState x:Name="PointerFocused"/>
                                <VisualState x:Name="Focused">
                                    <Storyboard>
                                        <DoubleAnimation Storyboard.TargetName="FocusBackground" Storyboard.TargetProperty="Opacity" To="1" Duration="0" />
                                        <DoubleAnimation Storyboard.TargetName="FocusItem" Storyboard.TargetProperty="Opacity" To="1" Duration="0" />
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="Foreground">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource TelerikDateTimePickerFocusedForegroundBrush}"/>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Border x:Name="Background" Grid.ColumnSpan="2" Background="{TemplateBinding Background}"
                                BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}"/>
                        <Rectangle x:Name="Item" Fill="Transparent" Margin="{TemplateBinding BorderThickness}"/>
                        <Border x:Name="FocusBackground" 
                                Background="{StaticResource TelerikDateTimePickerFocusedBackgroundBrush}" 
                                BorderBrush="{StaticResource TelerikDateTimePickerFocusedBorderBrush}"
                                BorderThickness="{TemplateBinding BorderThickness}" Opacity="0" Grid.ColumnSpan="2"/>
                        <Rectangle x:Name="FocusItem" Fill="{StaticResource TelerikDateTimePickerItemFocusedBackgroundBrush}" 
                                   Margin="{TemplateBinding BorderThickness}" Opacity="0"/>
                        <ContentPresenter x:Name="ContentPresenter" Content="{TemplateBinding Content}"
                                          HorizontalAlignment="Left" VerticalAlignment="Center" Margin="{TemplateBinding Padding}"/>
                        <TextBlock x:Name="DropDownGlyph" Text="&#57361;" Grid.Column="1"
                                    IsHitTestVisible="False" Margin="0,0,6,4"
                                    Foreground="{TemplateBinding Foreground}"
                                    FontWeight="Bold" FontSize="{StaticResource ComboBoxArrowThemeFontSize}"
                                    FontFamily="{StaticResource SymbolThemeFontFamily}" HorizontalAlignment="Right" VerticalAlignment="Center" />
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    
    <Style TargetType="input:DateTimePicker" x:Key="BaseDateTimePickerStyle">
        <Setter Property="HorizontalAlignment" Value="Left"/>
        <Setter Property="VerticalAlignment" Value="Top"/>
        <Setter Property="IsTabStop" Value="False"/>
        <Setter Property="BorderBrush" Value="{StaticResource TelerikDateTimePickerBorderBrush}"/>
        <Setter Property="BorderThickness" Value="2"/>
        <Setter Property="SelectorBackgroundStyle">
            <Setter.Value>
                <Style TargetType="Border">
                    <Setter Property="Background" Value="{StaticResource TelerikDateTimePickerSelectorBackgroundBrush}"/>
                    <Setter Property="Padding" Value="5,0,5,0"/>
                    <Setter Property="BorderBrush" Value="{StaticResource TelerikDateTimePickerSelectorBorderBrush}"/>
                    <Setter Property="BorderThickness" Value="2"/>
                    <Setter Property="Transitions">
                        <Setter.Value>
                            <TransitionCollection>
                                <PopupThemeTransition/>
                            </TransitionCollection>
                        </Setter.Value>
                    </Setter>
                </Style>
            </Setter.Value>
        </Setter>
        <Setter Property="SelectorHeaderTemplate">
            <Setter.Value>
                <DataTemplate>
                    <TextBlock Text="{Binding}" FontFamily="Segoe UI Semilight" FontSize="26.667" Foreground="{StaticResource TelerikDateTimePickerSelectorForegroundBrush}" Margin="5,20,0,10"/>
                </DataTemplate>
            </Setter.Value>
        </Setter>
        <Setter Property="HeaderStyle">
            <Setter.Value>
                <Style TargetType="ContentControl">
                    <Setter Property="HorizontalAlignment" Value="Stretch"/>
                    <Setter Property="VerticalAlignment" Value="Stretch"/>
                    <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
                    <Setter Property="VerticalContentAlignment" Value="Stretch"/>
                    <Setter Property="Margin" Value="0 0 0 4"/>
                    <Setter Property="FontSize" Value="{StaticResource ControlContentThemeFontSize}"/>
                    <Setter Property="Foreground" Value="{StaticResource TelerikDateTimePickerHeaderForegroundBrush}"/>
                </Style>
            </Setter.Value>
        </Setter>
    </Style>
    
    <inputDateTime:DisplayModeToVisibilityConverter x:Key="DisplayModeConverter" VisibleDisplayMode="Standard"/>
    
    <Style TargetType="input:RadDatePicker" BasedOn="{StaticResource BaseDateTimePickerStyle}">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="input:RadDatePicker">
                    <Grid Background="{TemplateBinding Background}">
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition Height="*"/>
                        </Grid.RowDefinitions>
                        <ContentControl Content="{TemplateBinding Header}" ContentTemplate="{TemplateBinding HeaderTemplate}" Style="{TemplateBinding HeaderStyle}" IsTabStop="False"
                                        Visibility="{Binding DisplayMode, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource DisplayModeConverter}}"/>
                        <inputDateTime:DateTimePickerButton x:Name="PART_PickerButton" Grid.Row="1" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}"
                                                            Visibility="{Binding DisplayMode, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource DisplayModeConverter}}"/>
                        <Popup x:Name="PART_Popup" IsOpen="{TemplateBinding IsOpen}" IsLightDismissEnabled="True">
                            <Border x:Name="PART_SelectorLayoutRoot" Style="{TemplateBinding SelectorBackgroundStyle}">
                                <Grid>
                                    <Grid.RowDefinitions>
                                        <RowDefinition Height="Auto"/>
                                        <RowDefinition Height="*"/>
                                        <RowDefinition Height="Auto"/>
                                    </Grid.RowDefinitions>
                                    <ContentPresenter x:Name="PART_SelectorHeader" Content="{TemplateBinding SelectorHeader}" ContentTemplate="{TemplateBinding SelectorHeaderTemplate}"/>
                                    <Grid HorizontalAlignment="Center" Grid.Row="1">
                                        <Grid.ColumnDefinitions>
                                            <ColumnDefinition Width="Auto"/>
                                            <ColumnDefinition Width="Auto"/>
                                            <ColumnDefinition Width="Auto"/>
                                        </Grid.ColumnDefinitions>
                                        <inputDateTime:DateTimeList x:Name="PART_MonthList" ComponentType="Month"
                                                            ItemWidth="{TemplateBinding ItemLength}" 
                                                            ItemHeight="{TemplateBinding ItemLength}" 
                                                            ItemSpacing="{TemplateBinding ItemSpacing}"/>
                                        <inputDateTime:DateTimeList x:Name="PART_DayList" ComponentType="Day" Grid.Column="1"
                                                            ItemWidth="{TemplateBinding ItemLength}" 
                                                            ItemHeight="{TemplateBinding ItemLength}" 
                                                            ItemSpacing="{TemplateBinding ItemSpacing}"/>
                                        <inputDateTime:DateTimeList x:Name="PART_YearList" ComponentType="Year" Grid.Column="2"
                                                            ItemWidth="{TemplateBinding ItemLength}" 
                                                            ItemHeight="{TemplateBinding ItemLength}" 
                                                            ItemSpacing="{TemplateBinding ItemSpacing}"/>
                                    </Grid>
                                    <StackPanel Grid.Row="2" Orientation="Horizontal" HorizontalAlignment="Center" x:Name="PART_SelectorButtonsPanel" Margin="0,10,2,5">
                                        <Button x:Name="PART_SelectorOKButton" Style="{StaticResource SelectorButtonStyle}"
                                                Visibility="{Binding DisplayMode, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource DisplayModeConverter}}"/>
                                        <Button x:Name="PART_SelectorCancelButton" Style="{StaticResource SelectorButtonStyle}"
                                                Visibility="{Binding DisplayMode, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource DisplayModeConverter}}"/>
                                    </StackPanel>
                                </Grid>
                            </Border>
                        </Popup>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    
    <Style TargetType="input:RadTimePicker" BasedOn="{StaticResource BaseDateTimePickerStyle}">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="input:RadTimePicker">
                    <Grid Background="{TemplateBinding Background}">
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition Height="*"/>
                        </Grid.RowDefinitions>
                        <ContentControl Content="{TemplateBinding Header}" ContentTemplate="{TemplateBinding HeaderTemplate}" Style="{TemplateBinding HeaderStyle}" IsTabStop="False"
                                        Visibility="{Binding DisplayMode, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource DisplayModeConverter}}"/>
                        <inputDateTime:DateTimePickerButton x:Name="PART_PickerButton" Grid.Row="1"  BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}"
                                                            Visibility="{Binding DisplayMode, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource DisplayModeConverter}}"/>
                        <Popup x:Name="PART_Popup" IsOpen="{TemplateBinding IsOpen}" IsLightDismissEnabled="True">
                            <Border x:Name="PART_SelectorLayoutRoot" 
                                    Style="{TemplateBinding SelectorBackgroundStyle}">
                                <Grid>
                                    <Grid.RowDefinitions>
                                        <RowDefinition Height="Auto"/>
                                        <RowDefinition Height="*"/>
                                        <RowDefinition Height="Auto"/>
                                    </Grid.RowDefinitions>
                                    <ContentPresenter x:Name="PART_SelectorHeader"
                                                      Content="{TemplateBinding SelectorHeader}"
                                                      ContentTemplate="{TemplateBinding SelectorHeaderTemplate}"/>
                                    <Grid HorizontalAlignment="Center" Grid.Row="1">
                                        <Grid.ColumnDefinitions>
                                            <ColumnDefinition Width="Auto"/>
                                            <ColumnDefinition Width="Auto"/>
                                            <ColumnDefinition Width="Auto"/>
                                        </Grid.ColumnDefinitions>
                                        <inputDateTime:DateTimeList x:Name="PART_HourList" ComponentType="Hour"
                                                            ItemWidth="{TemplateBinding ItemLength}" 
                                                            ItemHeight="{TemplateBinding ItemLength}" 
                                                            ItemSpacing="{TemplateBinding ItemSpacing}"/>
                                        <inputDateTime:DateTimeList x:Name="PART_MinuteList" ComponentType="Minute" Grid.Column="1"
                                                            ItemWidth="{TemplateBinding ItemLength}" 
                                                            ItemHeight="{TemplateBinding ItemLength}" 
                                                            ItemSpacing="{TemplateBinding ItemSpacing}"/>
                                        <inputDateTime:DateTimeList x:Name="PART_AMPMList" ComponentType="AMPM" Grid.Column="2"
                                                            ItemWidth="{TemplateBinding ItemLength}" 
                                                            ItemHeight="{TemplateBinding ItemLength}" 
                                                            ItemSpacing="{TemplateBinding ItemSpacing}"/>
                                    </Grid>
                                    <StackPanel Grid.Row="2" Orientation="Horizontal" HorizontalAlignment="Center" x:Name="PART_SelectorButtonsPanel" Margin="0,10,2,5">
                                        <Button x:Name="PART_SelectorOKButton" Style="{StaticResource SelectorButtonStyle}"
                                                Visibility="{Binding DisplayMode, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource DisplayModeConverter}}"/>
                                        <Button x:Name="PART_SelectorCancelButton" Style="{StaticResource SelectorButtonStyle}"
                                                Visibility="{Binding DisplayMode, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource DisplayModeConverter}}"/>
                                    </StackPanel>
                                </Grid>
                            </Border>
                        </Popup>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    
</ResourceDictionary>

