<UserControl xmlns="https://github.com/avaloniaui"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
             xmlns:properties="clr-namespace:Artemis.UI.Screens.ProfileEditor.Properties"
             xmlns:timeline="clr-namespace:Artemis.UI.Screens.ProfileEditor.Properties.Timeline"
             xmlns:system="clr-namespace:System;assembly=netstandard"
             mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
             x:Class="Artemis.UI.Screens.ProfileEditor.Properties.Timeline.TimelineGroupView"
             x:DataType="timeline:TimelineGroupViewModel">
    <Grid RowDefinitions="28,1,Auto">
        <ItemsControl Grid.Row="0"
                      Height="28"
                      IsVisible="{CompiledBinding !PropertyGroupViewModel.IsExpanded}"
                      ItemsSource="{CompiledBinding KeyframePositions}"
                      HorizontalAlignment="Stretch">
            <ItemsControl.ItemsPanel>
                <ItemsPanelTemplate>
                    <Canvas />
                </ItemsPanelTemplate>
            </ItemsControl.ItemsPanel>
            <ItemsControl.Styles>
                <Style Selector="ContentPresenter" x:DataType="system:Double">
                    <Setter Property="Canvas.Left" Value="{CompiledBinding}" />
                    <Setter Property="Canvas.Top" Value="9" />
                </Style>
            </ItemsControl.Styles>
            <ItemsControl.ItemTemplate>
                <DataTemplate>
                    <Ellipse Fill="{DynamicResource ControlSolidFillColorDefaultBrush}"
                             Stroke="White"
                             StrokeThickness="0"
                             Width="10"
                             Height="10"
                             Margin="-5 0 0 0" />
                </DataTemplate>
            </ItemsControl.ItemTemplate>
        </ItemsControl>

        <Rectangle Grid.Row="1" HorizontalAlignment="Stretch" Fill="{DynamicResource ButtonBorderBrush}" Height="1" />

        <ItemsControl Grid.Row="2"
                      ItemsSource="{CompiledBinding Children}"
                      IsVisible="{CompiledBinding PropertyGroupViewModel.IsExpanded}"
                      HorizontalAlignment="Stretch">
            <ItemsControl.DataTemplates>
                <DataTemplate DataType="properties:PropertyGroupViewModel">
                    <ContentControl Content="{CompiledBinding TimelineGroupViewModel}" IsVisible="{CompiledBinding IsVisible}" />
                </DataTemplate>
                <DataTemplate DataType="properties:PropertyViewModel">
                    <ContentControl Content="{CompiledBinding TimelinePropertyViewModel}" IsVisible="{CompiledBinding IsVisible}" />
                </DataTemplate>
            </ItemsControl.DataTemplates>
        </ItemsControl>
    </Grid>

</UserControl>