<UserControl x:Class="PerformanceMonitorLite.Controls.CorrelatedTimelineLanesControl"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:ScottPlot="clr-namespace:ScottPlot.WPF;assembly=ScottPlot.WPF">

    <Grid Margin="8">
        <Grid.RowDefinitions>
            <!-- 5 lanes, equal height -->
            <RowDefinition Height="*"/>
            <RowDefinition Height="*"/>
            <RowDefinition Height="*"/>
            <RowDefinition Height="*"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>

        <!-- Lane 1: CPU -->
        <Grid Grid.Row="0" Margin="0,0,0,2">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="100"/>
                <ColumnDefinition Width="*"/>
            </Grid.ColumnDefinitions>
            <TextBlock Grid.Column="0" Text="CPU %" VerticalAlignment="Center"
                       FontSize="12" FontWeight="SemiBold"
                       Foreground="{DynamicResource ForegroundBrush}" Margin="4,0"/>
            <ScottPlot:WpfPlot Grid.Column="1" x:Name="CpuChart"/>
        </Grid>

        <!-- Lane 2: Wait Stats -->
        <Grid Grid.Row="1" Margin="0,2,0,2">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="100"/>
                <ColumnDefinition Width="*"/>
            </Grid.ColumnDefinitions>
            <TextBlock Grid.Column="0" Text="Wait ms/sec" VerticalAlignment="Center"
                       FontSize="12" FontWeight="SemiBold"
                       Foreground="{DynamicResource ForegroundBrush}" Margin="4,0"/>
            <ScottPlot:WpfPlot Grid.Column="1" x:Name="WaitStatsChart"/>
        </Grid>

        <!-- Lane 3: Blocking -->
        <Grid Grid.Row="2" Margin="0,2,0,2">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="100"/>
                <ColumnDefinition Width="*"/>
            </Grid.ColumnDefinitions>
            <TextBlock Grid.Column="0" VerticalAlignment="Center"
                       FontSize="12" FontWeight="SemiBold"
                       Foreground="{DynamicResource ForegroundBrush}" Margin="4,0">
                <Run Text="Blocking &amp;"/>
                <LineBreak/>
                <Run Text="Deadlocking"/>
            </TextBlock>
            <ScottPlot:WpfPlot Grid.Column="1" x:Name="BlockingChart"/>
        </Grid>

        <!-- Lane 4: Buffer Pool -->
        <Grid Grid.Row="3" Margin="0,2,0,2">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="100"/>
                <ColumnDefinition Width="*"/>
            </Grid.ColumnDefinitions>
            <TextBlock Grid.Column="0" Text="Buffer Pool MB" VerticalAlignment="Center"
                       FontSize="12" FontWeight="SemiBold"
                       Foreground="{DynamicResource ForegroundBrush}" Margin="4,0"/>
            <ScottPlot:WpfPlot Grid.Column="1" x:Name="MemoryChart"/>
        </Grid>

        <!-- Lane 5: File I/O -->
        <Grid Grid.Row="4" Margin="0,2,0,0">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="100"/>
                <ColumnDefinition Width="*"/>
            </Grid.ColumnDefinitions>
            <TextBlock Grid.Column="0" Text="I/O Latency" VerticalAlignment="Center"
                       FontSize="12" FontWeight="SemiBold"
                       Foreground="{DynamicResource ForegroundBrush}" Margin="4,0"/>
            <ScottPlot:WpfPlot Grid.Column="1" x:Name="FileIoChart"/>
        </Grid>
    </Grid>
</UserControl>
