Загрузка данных


<Window x:Class="KeyboardTrainer.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="Клавиатурный тренажер" 
        Height="700" 
        Width="1000"
        WindowStartupLocation="CenterScreen"
        KeyDown="Window_KeyDown">
    
    <Window.Resources>
        <Style x:Key="KeyButtonStyle" TargetType="Button">
            <Setter Property="Width" Value="50"/>
            <Setter Property="Height" Value="45"/>
            <Setter Property="Margin" Value="2"/>
            <Setter Property="FontSize" Value="12"/>
            <Setter Property="FontWeight" Value="Bold"/>
            <Setter Property="Background" Value="#E8E8E8"/>
            <Setter Property="BorderBrush" Value="#888888"/>
            <Setter Property="BorderThickness" Value="1"/>
            <Setter Property="Cursor" Value="Arrow"/>
            <Setter Property="IsEnabled" Value="False"/>
        </Style>
    </Window.Resources>

    <Grid Margin="10">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>

        <!-- Верхняя панель -->
        <Border Grid.Row="0" Background="#F0F0F0" Padding="10" Margin="0,0,0,10">
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="*"/>
                    <ColumnDefinition Width="*"/>
                    <ColumnDefinition Width="*"/>
                    <ColumnDefinition Width="Auto"/>
                    <ColumnDefinition Width="Auto"/>
                    <ColumnDefinition Width="Auto"/>
                </Grid.ColumnDefinitions>

                <StackPanel Grid.Column="0" Orientation="Horizontal">
                    <TextBlock Text="Скорость:" FontWeight="Bold" Margin="0,0,5,0"/>
                    <TextBlock x:Name="SpeedText" Text="0 симв/мин" Foreground="Blue"/>
                </StackPanel>

                <StackPanel Grid.Column="1" Orientation="Horizontal" Margin="20,0,0,0">
                    <TextBlock Text="Ошибки:" FontWeight="Bold" Margin="0,0,5,0"/>
                    <TextBlock x:Name="ErrorsText" Text="0" Foreground="Red"/>
                </StackPanel>

                <StackPanel Grid.Column="2" Orientation="Horizontal" Margin="20,0,0,0">
                    <TextBlock Text="Прогресс:" FontWeight="Bold" Margin="0,0,5,0"/>
                    <TextBlock x:Name="ProgressText" Text="0%" Foreground="Green"/>
                </StackPanel>

                <Button x:Name="StartButton" Grid.Column="3" Content="Начать" Width="100" Height="30" Margin="10,0" Background="LightGreen" Click="StartButton_Click"/>
                <Button x:Name="StopButton" Grid.Column="4" Content="Стоп" Width="100" Height="30" Margin="0,0,10,0" Background="LightCoral" IsEnabled="False" Click="StopButton_Click"/>
                
                <ComboBox x:Name="DifficultyComboBox" Grid.Column="5" Width="120" Height="30" SelectedIndex="1" SelectionChanged="DifficultyComboBox_SelectionChanged">
                    <ComboBoxItem Content="Легкий"/>
                    <ComboBoxItem Content="Средний"/>
                    <ComboBoxItem Content="Сложный"/>
                </ComboBox>
            </Grid>
        </Border>

        <!-- Текст -->
        <Border Grid.Row="1" Background="White" Padding="10" Margin="0,0,0,10" Height="60">
            <TextBlock x:Name="TargetTextBlock" 
                       Text="Нажмите 'Начать'" 
                       FontFamily="Consolas" 
                       FontSize="20" 
                       FontWeight="Bold"
                       TextAlignment="Center"
                       VerticalAlignment="Center"/>
        </Border>

        <!-- Клавиатура -->
        <ScrollViewer Grid.Row="2">
            <StackPanel x:Name="KeyboardPanel" Margin="10" HorizontalAlignment="Center"/>
        </ScrollViewer>
    </Grid>
</Window>