Загрузка данных
<Window x:Class="SlsWpf.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2000/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2000/xaml"
Title="Slay the Spire - WPF Edition" Height="650" Width="900"
Background="#181818" WindowStartupLocation="CenterScreen">
<Grid Margin="20">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/> <!-- Статус игры / Победа / Поражение -->
<RowDefinition Height="2*"/> <!-- Зона Врага -->
<RowDefinition Height="2*"/> <!-- Зона Игрока -->
<RowDefinition Height="Auto"/> <!-- Панель Энергии и кнопка Конец Хода -->
<RowDefinition Height="3*"/> <!-- Рука с картами -->
</Grid.RowDefinitions>
<!-- Системные сообщения -->
<TextBlock x:Name="TxtLog" Grid.Row="0" Foreground="#FFCC00" FontSize="16" HorizontalAlignment="Center" FontWeight="Bold" Margin="0,0,0,10"/>
<!-- ВРАГ -->
<StackPanel Grid.Row="1" HorizontalAlignment="Center" VerticalAlignment="Center">
<Border Background="#331010" BorderBrush="#FF4444" BorderThickness="2" CornerRadius="10" Padding="15" Width="220">
<StackPanel>
<TextBlock Text="КУЛЬТИСТ" Foreground="White" FontSize="18" FontWeight="Bold" HorizontalAlignment="Center"/>
<TextBlock x:Name="TxtEnemyHp" Text="HP: 50/50" Foreground="#FF4444" FontSize="16" HorizontalAlignment="Center" Margin="0,5"/>
<TextBlock x:Name="TxtEnemyBlock" Text="Броня: 0" Foreground="#4488FF" FontSize="14" HorizontalAlignment="Center"/>
</StackPanel>
</Border>
<!-- Намерение врага (Intent) -->
<Border Background="#222" CornerRadius="5" Margin="0,5,0,0" HorizontalAlignment="Center" Padding="8,4">
<TextBlock x:Name="TxtEnemyIntent" Text="Намерение: Атака (6 урона)" Foreground="#FF9900" FontSize="13" FontWeight="Bold"/>
</Border>
</StackPanel>
<!-- ИГРОК -->
<StackPanel Grid.Row="2" HorizontalAlignment="Center" VerticalAlignment="Center">
<Border Background="#102033" BorderBrush="#00AAFF" BorderThickness="2" CornerRadius="10" Padding="15" Width="220">
<StackPanel>
<TextBlock Text="ЖЕЛЕЗОБРАЗНЫЙ" Foreground="White" FontSize="18" FontWeight="Bold" HorizontalAlignment="Center"/>
<TextBlock x:Name="TxtPlayerHp" Text="HP: 80/80" Foreground="#FF4444" FontSize="16" HorizontalAlignment="Center" Margin="0,5"/>
<TextBlock x:Name="TxtPlayerBlock" Text="Броня: 0" Foreground="#4488FF" FontSize="14" HorizontalAlignment="Center"/>
</StackPanel>
</Border>
</StackPanel>
<!-- Интерфейс Энергии и Конец хода -->
<Grid Grid.Row="3" Width="500" Margin="0,10">
<TextBlock x:Name="TxtEnergy" Text="Энергия: 3 / 3" Foreground="#00FFCC" FontSize="18" FontWeight="Bold" VerticalAlignment="Center" HorizontalAlignment="Left"/>
<Button Content="КОНЕЦ ХОДА" Click="BtnEndTurn_Click" Width="130" Height="35" Background="#443322" Foreground="White" FontWeight="Bold" HorizontalAlignment="Right">
<Button.Resources>
<Style TargetType="Button">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Button">
<Border Background="{TemplateBinding Background}" CornerRadius="5" BorderBrush="#886644" BorderThickness="1">
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</Button.Resources>
</Button>
</Grid>
<!-- Карты в руке игрока -->
<ItemsControl x:Name="HandItemsControl" Grid.Row="4" HorizontalAlignment="Center">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel Orientation="Horizontal"/>
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate>
<DataTemplate>
<!-- Кнопка-Карта -->
<Button Click="Card_Click" Margin="10,0" Width="130" Height="180" Background="#2A2A3A" Foreground="White">
<Button.Resources>
<Style TargetType="Button">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Button">
<Border Background="{TemplateBinding Background}" CornerRadius="8" BorderBrush="#555577" BorderThickness="2" Padding="10">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<!-- Название и стоимость -->
<TextBlock Text="{Binding Name}" FontWeight="Bold" FontSize="14" TextWrapping="Wrap" HorizontalAlignment="Center" TextAlignment="Center"/>
<!-- Описание -->
<TextBlock Grid.Row="1" Text="{Binding Description}" FontSize="11" Foreground="#CCC" TextWrapping="Wrap" VerticalAlignment="Center" HorizontalAlignment="Center" TextAlignment="Center"/>
<!-- Стоимость Энергии -->
<Border Grid.Row="2" Background="#00FFCC" Width="24" Height="24" CornerRadius="12" HorizontalAlignment="Center">
<TextBlock Text="{Binding Cost}" Foreground="Black" FontWeight="Bold" HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Border>
</Grid>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" Value="#3A3A55"/>
<Setter Property="Cursor" Value="Hand"/>
</Trigger>
</Style.Triggers>
</Style>
</Button.Resources>
</Button>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</Grid>
</Window>