<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:hy="clr-namespace:HytaleClient.UI.Common">

    <!-- Converters -->
    <!-- Timeline Styles -->
    <Style x:Key="TimelineTrackStyle" TargetType="Border">
        <Setter Property="Background">
            <Setter.Value>
                <SolidColorBrush Color="{StaticResource Blue1000}"/>
            </Setter.Value>
        </Setter>
        <Setter Property="BorderBrush" Value="#3E3E42"/>
        <Setter Property="BorderThickness" Value="0,0,0,1"/>
        <Setter Property="MinHeight" Value="40"/>
    </Style>

    <!-- Header-only style for fixed left headers -->
    <Style x:Key="TimelineTrackHeaderStyle" TargetType="{x:Type hy:TimelineTrackControl}">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type hy:TimelineTrackControl}">
                    <Border Height="40">
                        <Border.Style>
                            <Style TargetType="Border" BasedOn="{StaticResource TimelineTrackStyle}">
                                <Style.Triggers>
                                    <DataTrigger Binding="{Binding IsSelected}" Value="True">
                                        <Setter Property="Background" Value="{StaticResource Color.BackgroundPrimary}"/>
                                    </DataTrigger>
                                </Style.Triggers>
                            </Style>
                        </Border.Style>
                        <Grid>
                            <!-- Track Header -->
                            <Border Name="PART_TrackHeader" Background="Transparent">
                                <Grid Margin="5">
                                    <Grid.ContextMenu>
                                        <ContextMenu Style="{StaticResource Style.ContextMenu}"
                                                     ItemsSource="{Binding ContextMenuItems}">
                                            <ContextMenu.ItemContainerStyle>
                                                <Style TargetType="MenuItem" BasedOn="{StaticResource Style.ContextMenuItem}">
                                                    <Setter Property="Header" Value="{Binding Header}"/>
                                                    <Setter Property="Command" Value="{Binding Command}"/>
                                                    <Setter Property="CommandParameter" Value="{Binding CommandParameter}"/>
                                                    <Setter Property="IsCheckable" Value="{Binding IsCheckable}"/>
                                                    <Setter Property="IsChecked" Value="{Binding IsChecked, Mode=TwoWay}"/>
                                                    <Setter Property="ItemsSource" Value="{Binding Children}"/>
                                                    <Style.Triggers>
                                                        <DataTrigger Binding="{Binding IsSeparator}" Value="True">
                                                            <Setter Property="Template">
                                                                <Setter.Value>
                                                                    <ControlTemplate TargetType="MenuItem">
                                                                        <Separator/>
                                                                    </ControlTemplate>
                                                                </Setter.Value>
                                                            </Setter>
                                                        </DataTrigger>
                                                    </Style.Triggers>
                                                </Style>
                                            </ContextMenu.ItemContainerStyle>
                                        </ContextMenu>
                                    </Grid.ContextMenu>
                                    <!-- Track Header Columns -->
                                    <!-- Track Header -->
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="*"/>
                                        <ColumnDefinition Width="Auto"/>
                                        <ColumnDefinition Width="Auto"/>
                                    </Grid.ColumnDefinitions>

                                    <!-- Track Name -->
                                    <TextBlock Grid.Column="0" Text="{Binding Name}" ToolTip="{Binding Description}" VerticalAlignment="Center" Margin="5,0">
                                        <TextBlock.Style>
                                            <Style TargetType="TextBlock">
                                                <Setter Property="Foreground" Value="White"/>
                                                <Style.Triggers>
                                                    <DataTrigger Binding="{Binding IsMuted}" Value="True">
                                                        <Setter Property="Foreground" Value="#9E9E9E"/>
                                                    </DataTrigger>
                                                </Style.Triggers>
                                            </Style>
                                        </TextBlock.Style>
                                    </TextBlock>

                                    <!-- Mute Button -->
                                    <ToggleButton
                                        Grid.Column="1"
                                        Content="M"
                                        ToolTip="{hy:Loc client.controls.timeline.tooltip.muteTrack}"
                                        Margin="10,0,0,0"
                                        Width="28"
                                        Height="28"
                                        Padding="0"
                                        IsChecked="{Binding IsMuted}">
                                        <ToggleButton.Style>
                                            <Style TargetType="ToggleButton" BasedOn="{StaticResource Style.ToggleButton.Secondary}">
                                                <Setter Property="Visibility" Value="Collapsed"/>
                                                <Style.Triggers>
                                                    <DataTrigger Binding="{Binding IsMouseOver, ElementName=PART_TrackHeader}" Value="True">
                                                        <Setter Property="Visibility" Value="Visible"/>
                                                    </DataTrigger>
                                                </Style.Triggers>
                                            </Style>
                                        </ToggleButton.Style>
                                    </ToggleButton>
                                </Grid>
                            </Border>
                        </Grid>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="KeyframeStyle" TargetType="Path">
        <Setter Property="Width" Value="16"/>
        <Setter Property="Height" Value="16"/>
        <Setter Property="Stroke" Value="{DynamicResource Color.Text}"/>
        <Setter Property="Fill" Value="{StaticResource Color.BackgroundSecondary}"/>
        <Setter Property="StrokeThickness" Value="2"/>
        <Setter Property="Cursor" Value="Hand"/>
    </Style>

    <Style x:Key="PlayheadStyle" TargetType="Rectangle">
        <Setter Property="Width" Value="2"/>
        <Setter Property="Fill" Value="#FF0000"/>
        <Setter Property="Stroke" Value="#FFFFFF"/>
        <Setter Property="StrokeThickness" Value="1"/>
    </Style>

    <Style x:Key="TimelineButtonStyle" TargetType="Button">
        <Setter Property="Height" Value="30"/>
        <Setter Property="Width" Value="30"/>
        <Setter Property="Margin" Value="2"/>
        <Setter Property="Background" Value="#3E3E42"/>
        <Setter Property="Foreground" Value="#FFFFFF"/>
        <Setter Property="BorderBrush" Value="#555555"/>
        <Setter Property="BorderThickness" Value="1"/>
        <Setter Property="Padding" Value="0"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="Button">
                    <Border Background="{TemplateBinding Background}"
                            BorderBrush="{TemplateBinding BorderBrush}"
                            BorderThickness="{TemplateBinding BorderThickness}"
                            CornerRadius="2">
                        <ContentPresenter HorizontalAlignment="Center"
                                        VerticalAlignment="Center"
                                        Margin="{TemplateBinding Padding}"/>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="TimelinePlayPauseButtonStyle" TargetType="Button" BasedOn="{StaticResource Style.Button.Secondary}">
        <Setter Property="Width" Value="35"/>
        <Setter Property="Height" Value="35"/>
        <Setter Property="Padding" Value="0"/>
        <Setter Property="Command" Value="{Binding PlayCommand, RelativeSource={RelativeSource AncestorType=hy:TimelineControl}}"/>
        <Setter Property="Content">
            <Setter.Value>
                <Path Data="M3,2 L3,10 L9,6 Z" Fill="{StaticResource Color.Text}" Width="12" Height="12" Stretch="Uniform"/>
            </Setter.Value>
        </Setter>
        <Style.Triggers>
            <DataTrigger Binding="{Binding Timeline.IsPlaying, RelativeSource={RelativeSource AncestorType=hy:TimelineControl}}" Value="True">
                <Setter Property="Command" Value="{Binding PauseCommand, RelativeSource={RelativeSource AncestorType=hy:TimelineControl}}"/>
                <Setter Property="Content">
                    <Setter.Value>
                        <Grid Width="12" Height="12">
                            <Rectangle Width="3" Height="12" Fill="{StaticResource Color.Text}" HorizontalAlignment="Left"/>
                            <Rectangle Width="3" Height="12" Fill="{StaticResource Color.Text}" HorizontalAlignment="Right"/>
                        </Grid>
                    </Setter.Value>
                </Setter>
            </DataTrigger>
        </Style.Triggers>
    </Style>

    <Style x:Key="TimelineStopButtonStyle" TargetType="Button" BasedOn="{StaticResource Style.Button.Secondary}">
        <Setter Property="Width" Value="35"/>
        <Setter Property="Height" Value="35"/>
        <Setter Property="Padding" Value="0"/>
        <Setter Property="Command" Value="{Binding StopCommand, RelativeSource={RelativeSource AncestorType=hy:TimelineControl}}"/>
        <Setter Property="Content">
            <Setter.Value>
                <Rectangle Width="12" Height="12" Fill="{StaticResource Color.Text}"/>
            </Setter.Value>
        </Setter>
    </Style>

    <!-- Default TimelineControl Template -->
    <Style TargetType="{x:Type hy:TimelineControl}">
        <Setter Property="Background" Value="{StaticResource Color.BackgroundSecondary}"/>
        <Setter Property="RulerLineStyle">
            <Setter.Value>
                <Style TargetType="Line">
                    <Setter Property="Stroke" Value="#819E9E9E"/>
                </Style>
            </Setter.Value>
        </Setter>
        <Setter Property="RulerLabelStyle">
            <Setter.Value>
                <Style TargetType="TextBlock">
                    <Setter Property="Foreground" Value="#ffffff"/>
                    <Setter Property="FontSize" Value="12"/>
                    <Setter Property="HorizontalAlignment" Value="Center"/>
                    <Setter Property="TextAlignment" Value="Center"/>
                    <Setter Property="Canvas.Top" Value="10"/>
                </Style>
            </Setter.Value>
        </Setter>
        <Setter Property="HeaderTemplate">
            <Setter.Value>
                <DataTemplate>
                    <ToolBar ToolBarTray.IsLocked="True" Height="45" Background="Transparent" Padding="5">
                        <ToolBar.Resources>
                            <Style x:Key="{x:Static ToolBar.SeparatorStyleKey}" TargetType="{x:Type Separator}">
                                <Setter Property="Template">
                                    <Setter.Value>
                                        <ControlTemplate TargetType="Separator">
                                            <Border
                                                Width="1"
                                                Margin="4,0"
                                                Background="{StaticResource Color.BorderOutPrimary}" /> <!-- your color -->
                                        </ControlTemplate>
                                    </Setter.Value>
                                </Setter>
                            </Style>
                            <Style TargetType="{x:Type Thumb}">
                                <Setter Property="Visibility" Value="Collapsed"/>
                            </Style>
                        </ToolBar.Resources>

                        <Button Style="{StaticResource TimelinePlayPauseButtonStyle}"
                                Margin="0 0 5 0"
                                ToolTip="{hy:Loc client.controls.timeline.tooltip.playPause}"/>
                        <Button Style="{StaticResource TimelineStopButtonStyle}"
                                ToolTip="{hy:Loc client.controls.timeline.tooltip.stop}"/>

                        <Separator />

                        <Button
                                Content="+"
                                Height="35"
                                Width="35"
                                Padding="0"
                                Style="{StaticResource Style.Button.Secondary}"
                                Command="{Binding AddTrackCommand, RelativeSource={RelativeSource AncestorType=hy:TimelineControl}}"
                                ToolTip="{hy:Loc client.controls.timeline.tooltip.addTrack}"/>

                        <ToggleButton
                                Content="{hy:Loc client.controls.timeline.button.autoRestart}"
                                Height="35"
                                Padding="7 0"
                                Margin="5 0 0 0"
                                IsChecked="{Binding Timeline.IsLooping, RelativeSource={RelativeSource AncestorType=hy:TimelineControl}}"
                                Style="{StaticResource Style.ToggleButton.Secondary}"
                                Command="{Binding ToggleLoopCommand, RelativeSource={RelativeSource AncestorType=hy:TimelineControl}}"
                                ToolTip="{hy:Loc client.controls.timeline.tooltip.toggleLoop}"/>

                        <Separator />

                        <!-- Timeline Info -->
                        <TextBlock Foreground="White" VerticalAlignment="Center" Margin="10,0">
                            <TextBlock.Text>
                                <hy:LocExtension ResourceKey="client.controls.timeline.label.time">
                                    <hy:LocExtension.Params>
                                        <hy:LocParam Key="time" Binding="Timeline.CurrentTimeInSeconds" RelativeSource="{RelativeSource AncestorType=hy:TimelineControl}" StringFormat="F2" />
                                    </hy:LocExtension.Params>
                                </hy:LocExtension>
                            </TextBlock.Text>
                        </TextBlock>
                        <Separator />

                        <TextBlock Foreground="White" VerticalAlignment="Center" Margin="10,0">
                            <TextBlock.Text>
                                <hy:LocExtension ResourceKey="client.controls.timeline.label.frame">
                                    <hy:LocExtension.Params>
                                        <hy:LocParam Key="frame" Binding="Timeline.CurrentTime" RelativeSource="{RelativeSource AncestorType=hy:TimelineControl}" StringFormat="F1" />
                                    </hy:LocExtension.Params>
                                </hy:LocExtension>
                            </TextBlock.Text>
                        </TextBlock>
                    </ToolBar>
                </DataTemplate>
            </Setter.Value>
        </Setter>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type hy:TimelineControl}">
                    <Grid Background="{TemplateBinding Background}">
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition Height="*"/>
                            <RowDefinition Height="Auto"/>
                        </Grid.RowDefinitions>

                        <!-- Control Bar -->
                        <Border Grid.Row="0" BorderBrush="{StaticResource Color.BorderOutPrimary}" BorderThickness="0,0,0,1">
                            <ContentPresenter
                                ContentSource="Header"
                                ContentTemplate="{TemplateBinding HeaderTemplate}"
                            />
                        </Border>

                        <!-- Timeline Area: fixed left headers, horizontally scrollable right contents -->
                        <Grid Grid.Row="1" Background="{StaticResource Color.BackgroundSecondary}">
                            <Grid.RowDefinitions>
                                <RowDefinition Height="40"/>
                                <RowDefinition Height="*"/>
                            </Grid.RowDefinitions>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="{TemplateBinding TrackHeaderWidth}"/>
                                <ColumnDefinition Width="*"/>
                                <ColumnDefinition Width="450"/>
                            </Grid.ColumnDefinitions>

                            <!-- Fixed top-left header background -->
                            <Border Grid.Row="0" Grid.Column="0" BorderBrush="{StaticResource Color.BackgroundSecondary}" BorderThickness="0,0,0,1">
                                <Border.Background>
                                    <SolidColorBrush Color="{StaticResource Blue1100}"/>
                                </Border.Background>
                            </Border>

                            <ScrollViewer Name="PART_TimeRulerScrollViewer" Grid.Row="0" Grid.Column="1" HorizontalScrollBarVisibility="Hidden" VerticalScrollBarVisibility="Disabled">
                                <Border BorderBrush="{StaticResource Color.BackgroundSecondary}" BorderThickness="0,0,0,1">
                                    <Border.Background>
                                        <SolidColorBrush Color="{StaticResource Blue1100}"/>
                                    </Border.Background>
                                    <Canvas Name="PART_TimeRulerCanvas" Margin="20,0,0,0" HorizontalAlignment="Left">
                                        <Canvas.Background>
                                            <SolidColorBrush Color="{StaticResource Blue1100}"/>
                                        </Canvas.Background>
                                        <Rectangle Name="PART_Playhead" Width="1" Height="40" Fill="#FFFFFF" StrokeThickness="1" Canvas.Left="50" IsHitTestVisible="True" Cursor="SizeWE"/>
                                    </Canvas>
                                </Border>
                            </ScrollViewer>


                            <!-- Fixed left track headers list -->
                            <ScrollViewer Name="PART_TrackListScrollViewer" Grid.Row="1" Grid.Column="0" HorizontalScrollBarVisibility="Disabled" VerticalScrollBarVisibility="Hidden">
                                <ItemsControl ItemsSource="{Binding Timeline.Tracks, RelativeSource={RelativeSource TemplatedParent}}"
                                            Background="{StaticResource Color.BackgroundSecondary}" BorderBrush="#3E3E42" BorderThickness="0,0,1,0">
                                    <ItemsControl.ItemsPanel>
                                        <ItemsPanelTemplate>
                                            <StackPanel/>
                                        </ItemsPanelTemplate>
                                    </ItemsControl.ItemsPanel>
                                    <ItemsControl.ItemTemplate>
                                        <DataTemplate>
                                            <hy:TimelineTrackControl Track="{Binding}" Style="{StaticResource TimelineTrackHeaderStyle}" />
                                        </DataTemplate>
                                    </ItemsControl.ItemTemplate>
                                </ItemsControl>
                            </ScrollViewer>

                            <!-- Right side with shared horizontal scroll -->
                            <ScrollViewer Name="PART_TimelineContentScrollViewer" Grid.Row="1" Grid.Column="1" HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto">
                                <Grid Name="PART_TimelineContent" HorizontalAlignment="Left">
                                    <Grid.RowDefinitions>
                                        <RowDefinition Height="*"/>
                                    </Grid.RowDefinitions>

                                    <!-- Tracks Area (scrolled horizontally) -->
                                    <Grid Grid.Row="0">
                                        <ItemsControl Name="TracksItems" ItemsSource="{Binding Timeline.Tracks, RelativeSource={RelativeSource TemplatedParent}}" Background="{StaticResource Color.BackgroundSecondary}">
                                            <ItemsControl.ItemTemplate>
                                                <DataTemplate>
                                                    <hy:TimelineTrackControl
                                                        Track="{Binding}"
                                                        PixelsPerTimeUnit="{Binding PixelsPerTimeUnit, RelativeSource={RelativeSource AncestorType=hy:TimelineControl}}"
                                                    />
                                                </DataTemplate>
                                            </ItemsControl.ItemTemplate>
                                        </ItemsControl>
                                        <Canvas Name="PlayheadLineCanvas" Margin="20,0,0,0" IsHitTestVisible="False" Panel.ZIndex="1000">
                                            <Rectangle Name="PART_PlayheadLine" Width="1" Fill="#FFFFFF" Canvas.Left="0" Canvas.Top="0"
                                                       Height="{Binding ActualHeight, ElementName=TracksItems}"/>
                                        </Canvas>
                                    </Grid>
                                </Grid>
                            </ScrollViewer>

                            <Border Grid.Row="0" Grid.RowSpan="2" Grid.Column="2" BorderBrush="#3E3E42" BorderThickness="1,0,0,0">
                                <Border.Background>
                                    <SolidColorBrush Color="{StaticResource Blue1100}"/>
                                </Border.Background>
                                <ContentPresenter Content="{Binding KeyframeContent, RelativeSource={RelativeSource TemplatedParent}}"/>
                            </Border>
                        </Grid>

                        <!-- Status Bar -->
                        <Border Grid.Row="2"
                                Background="{StaticResource Color.BackgroundSecondary}"
                                BorderBrush="#3E3E42"
                                BorderThickness="0,1,0,0"
                                Padding="5 0"
                                Height="25">
                            <StackPanel Orientation="Horizontal">
                                <TextBlock VerticalAlignment="Center" Margin="0,0,20,0">
                                    <TextBlock.Foreground>
                                        <SolidColorBrush Color="{StaticResource Blue300}"/>
                                    </TextBlock.Foreground>
                                    <TextBlock.Text>
                                        <hy:LocExtension ResourceKey="client.controls.timeline.label.duration">
                                            <hy:LocExtension.Params>
                                                <hy:LocParam Key="duration" Binding="Timeline.Duration" RelativeSource="{RelativeSource TemplatedParent}" StringFormat="F2" />
                                            </hy:LocExtension.Params>
                                        </hy:LocExtension>
                                    </TextBlock.Text>
                                </TextBlock>
                                <TextBlock VerticalAlignment="Center" Margin="0,0,20,0">
                                    <TextBlock.Foreground>
                                        <SolidColorBrush Color="{StaticResource Blue300}"/>
                                    </TextBlock.Foreground>
                                    <TextBlock.Text>
                                        <hy:LocExtension ResourceKey="client.controls.timeline.label.fps">
                                            <hy:LocExtension.Params>
                                                <hy:LocParam Key="fps" Binding="Timeline.FrameRate" RelativeSource="{RelativeSource TemplatedParent}" />
                                            </hy:LocExtension.Params>
                                        </hy:LocExtension>
                                    </TextBlock.Text>
                                </TextBlock>
                            </StackPanel>
                        </Border>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <DataTemplate DataType="{x:Type hy:Keyframe}">
        <Path Margin="-8,0,0,0">
            <Path.Data>
                <PathGeometry>
                    <PathFigure StartPoint="8,0">
                        <LineSegment Point="16,8"/>
                        <LineSegment Point="8,16"/>
                        <LineSegment Point="0,8"/>
                        <LineSegment Point="8,0"/>
                    </PathFigure>
                </PathGeometry>
            </Path.Data>
            <Path.Style>
                <Style TargetType="Path" BasedOn="{StaticResource KeyframeStyle}">
                    <Style.Triggers>
                        <DataTrigger Binding="{Binding IsMuted, RelativeSource={RelativeSource AncestorType=hy:TimelineKeyframeControl}}" Value="True">
                            <Setter Property="Fill" Value="{StaticResource Color.BackgroundSecondary}"/>
                            <Setter Property="Stroke" Value="{StaticResource Color.BorderOutSecondary}"/>
                        </DataTrigger>
                        <DataTrigger Binding="{Binding IsSelected}" Value="True">
                            <Setter Property="Fill" Value="{StaticResource Color.BackgroundSecondary}"/>
                            <Setter Property="Stroke" Value="{StaticResource Color.BorderHover}"/>
                        </DataTrigger>
                    </Style.Triggers>
                </Style>
            </Path.Style>
            <Path.ToolTip>
                <TextBlock>
                    <TextBlock.Text>
                        <hy:LocExtension ResourceKey="client.controls.timeline.tooltip.keyframe">
                            <hy:LocExtension.Params>
                                <hy:LocParam Key="time" Binding="Time" StringFormat="0.###" />
                            </hy:LocExtension.Params>
                        </hy:LocExtension>
                    </TextBlock.Text>
                </TextBlock>
            </Path.ToolTip>
        </Path>
    </DataTemplate>

    <!-- TimelineTrackControl Template -->
    <Style TargetType="{x:Type hy:TimelineTrackControl}">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type hy:TimelineTrackControl}">
                    <Border Height="40">
                        <Border.Style>
                            <Style TargetType="Border" BasedOn="{StaticResource TimelineTrackStyle}">
                                <Style.Triggers>
                                    <DataTrigger Binding="{Binding IsSelected}" Value="True">
                                        <Setter Property="Background" Value="{StaticResource Color.BackgroundPrimary}"/>
                                    </DataTrigger>
                                </Style.Triggers>
                            </Style>
                        </Border.Style>
                        <Grid>
                            <!-- Track Content only -->
                            <Border Name="PART_TrackContent"
                                    Background="Transparent"
                                    Margin="20,0,0,0">
                                <!-- Keyframes will be drawn here -->
                                <ItemsControl Name="KeyframeItemsControl" ItemsSource="{Binding Keyframes}">
                                    <ItemsControl.ItemsPanel>
                                        <ItemsPanelTemplate>
                                            <Canvas
                                                Background="Transparent"
                                                ClipToBounds="False"
                                                MinHeight="40"
                                                Height="{Binding ActualHeight, ElementName=PART_TrackContent}"
                                            />
                                        </ItemsPanelTemplate>
                                    </ItemsControl.ItemsPanel>
                                    <ItemsControl.ItemContainerStyle>
                                        <Style TargetType="ContentPresenter">
                                            <Setter Property="Canvas.Top" Value="12"/>
                                        </Style>
                                    </ItemsControl.ItemContainerStyle>
                                    <ItemsControl.ItemTemplate>
                                        <DataTemplate>
                                            <Grid>
                                                <Grid.Resources>
                                                    <Style TargetType="hy:TimelineKeyframeControl">
                                                        <Setter Property="Template">
                                                            <Setter.Value>
                                                                <ControlTemplate TargetType="hy:TimelineKeyframeControl">
                                                                    <ContentControl Content="{Binding}"/>
                                                                </ControlTemplate>
                                                            </Setter.Value>
                                                        </Setter>
                                                    </Style>
                                                </Grid.Resources>

                                                <hy:TimelineKeyframeControl
                                                    Keyframe="{Binding}"
                                                    IsMuted="{Binding Track.IsMuted, RelativeSource={RelativeSource AncestorType=hy:TimelineTrackControl}}"
                                                />
                                            </Grid>
                                        </DataTemplate>
                                    </ItemsControl.ItemTemplate>
                                </ItemsControl>
                            </Border>
                        </Grid>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

</ResourceDictionary>
