упс 3,4,5,6 случайно

This commit is contained in:
Максим Яковлев 2024-04-01 23:39:13 +04:00
parent 53f3f356bd
commit 8a840a4738
10 changed files with 251 additions and 31 deletions

View File

@ -5,7 +5,180 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:project" xmlns:local="clr-namespace:project"
mc:Ignorable="d" mc:Ignorable="d"
Title="MainWindow" Height="520" Width="900" MinHeight="520" MinWidth="600"> Title="MainWindow" Height="530" Width="900" MinHeight="530" MinWidth="600">
<Window.Resources>
<SolidColorBrush x:Key="ButtonBackgroundBrush" Color="Gold"/>
<Style TargetType="Button">
<Setter Property="Background" Value="{StaticResource ButtonBackgroundBrush}"/>
<Setter Property="FontSize" Value="17"/>
<Setter Property="BorderThickness" Value="1" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Button">
<Border x:Name="border"
Background="{TemplateBinding Background}"
BorderThickness="{TemplateBinding BorderThickness}">
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center" />
</Border>
<ControlTemplate.Triggers>
<EventTrigger RoutedEvent="Button.MouseEnter">
<BeginStoryboard>
<Storyboard>
<ColorAnimation
Storyboard.TargetName="border"
Storyboard.TargetProperty="(Border.Background).(SolidColorBrush.Color)"
To="Goldenrod"
Duration="0:0:0.3"/>
</Storyboard>
</BeginStoryboard>
</EventTrigger>
<EventTrigger RoutedEvent="Button.MouseLeave">
<BeginStoryboard>
<Storyboard>
<ColorAnimation
Storyboard.TargetName="border"
Storyboard.TargetProperty="(Border.Background).(SolidColorBrush.Color)"
To="Gold"
Duration="0:0:0.3"/>
</Storyboard>
</BeginStoryboard>
</EventTrigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
<Style.Triggers>
<EventTrigger RoutedEvent="Mouse.MouseEnter">
<EventTrigger.Actions>
<BeginStoryboard>
<Storyboard>
<DoubleAnimation Duration="0:0:0.2" Storyboard.TargetProperty="FontSize" To="22" />
<DoubleAnimation Duration="0:0:0.2" Storyboard.TargetProperty="Height" To="40" />
</Storyboard>
</BeginStoryboard>
</EventTrigger.Actions>
</EventTrigger>
<EventTrigger RoutedEvent="Mouse.MouseLeave">
<EventTrigger.Actions>
<BeginStoryboard>
<Storyboard>
<DoubleAnimation Duration="0:0:1" Storyboard.TargetProperty="FontSize" />
<DoubleAnimation Duration="0:0:0.2" Storyboard.TargetProperty="Height" />
</Storyboard>
</BeginStoryboard>
</EventTrigger.Actions>
</EventTrigger>
</Style.Triggers>
</Style>
<Style TargetType="Button" x:Key="StopButtonStyle">
<Setter Property="Background" Value="OrangeRed"/>
<Setter Property="FontSize" Value="17"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Button">
<Border x:Name="border"
Background="{TemplateBinding Background}"
BorderThickness="{TemplateBinding BorderThickness}">
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center" />
</Border>
<ControlTemplate.Triggers>
<EventTrigger RoutedEvent="MouseEnter">
<BeginStoryboard>
<Storyboard>
<ColorAnimation Storyboard.TargetProperty="(Button.Background).(SolidColorBrush.Color)" To="Goldenrod" Duration="0:0:0.1" />
</Storyboard>
</BeginStoryboard>
</EventTrigger>
<EventTrigger RoutedEvent="MouseLeave">
<BeginStoryboard>
<Storyboard>
<ColorAnimation Storyboard.TargetProperty="(Button.Background).(SolidColorBrush.Color)" To="OrangeRed" Duration="0:0:0.1" />
</Storyboard>
</BeginStoryboard>
</EventTrigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
<Style.Triggers>
<EventTrigger RoutedEvent="Mouse.MouseEnter">
<EventTrigger.Actions>
<BeginStoryboard>
<Storyboard>
<DoubleAnimation Duration="0:0:0.2" Storyboard.TargetProperty="FontSize" To="19" />
<DoubleAnimation Duration="0:0:0.2" Storyboard.TargetProperty="Height" To="30" />
</Storyboard>
</BeginStoryboard>
</EventTrigger.Actions>
</EventTrigger>
<EventTrigger RoutedEvent="Mouse.MouseLeave">
<EventTrigger.Actions>
<BeginStoryboard>
<Storyboard>
<DoubleAnimation Duration="0:0:0.5" Storyboard.TargetProperty="FontSize" />
<DoubleAnimation Duration="0:0:0.5" Storyboard.TargetProperty="Height" />
</Storyboard>
</BeginStoryboard>
</EventTrigger.Actions>
</EventTrigger>
</Style.Triggers>
</Style>
<Style TargetType="Button" x:Key="StartButtonStyle">
<Setter Property="Background" Value="GreenYellow"/>
<Setter Property="FontSize" Value="17"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Button">
<Border x:Name="border"
Background="{TemplateBinding Background}"
BorderThickness="{TemplateBinding BorderThickness}">
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center" />
</Border>
<ControlTemplate.Triggers>
<EventTrigger RoutedEvent="MouseEnter">
<BeginStoryboard>
<Storyboard>
<ColorAnimation Storyboard.TargetProperty="(Button.Background).(SolidColorBrush.Color)" To="Goldenrod" Duration="0:0:0.1" />
</Storyboard>
</BeginStoryboard>
</EventTrigger>
<EventTrigger RoutedEvent="MouseLeave">
<BeginStoryboard>
<Storyboard>
<ColorAnimation Storyboard.TargetProperty="(Button.Background).(SolidColorBrush.Color)" To="OrangeRed" Duration="0:0:0.1" />
</Storyboard>
</BeginStoryboard>
</EventTrigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
<Style.Triggers>
<EventTrigger RoutedEvent="Mouse.MouseEnter">
<EventTrigger.Actions>
<BeginStoryboard>
<Storyboard>
<DoubleAnimation Duration="0:0:0.2" Storyboard.TargetProperty="FontSize" To="19" />
<DoubleAnimation Duration="0:0:0.2" Storyboard.TargetProperty="Height" To="30" />
</Storyboard>
</BeginStoryboard>
</EventTrigger.Actions>
</EventTrigger>
<EventTrigger RoutedEvent="Mouse.MouseLeave">
<EventTrigger.Actions>
<BeginStoryboard>
<Storyboard>
<DoubleAnimation Duration="0:0:0.5" Storyboard.TargetProperty="FontSize" />
<DoubleAnimation Duration="0:0:0.5" Storyboard.TargetProperty="Height" />
</Storyboard>
</BeginStoryboard>
</EventTrigger.Actions>
</EventTrigger>
</Style.Triggers>
</Style>
</Window.Resources>
<Grid x:Name="GridMain"> <Grid x:Name="GridMain">
<Grid.RowDefinitions> <Grid.RowDefinitions>
<RowDefinition Height="*"></RowDefinition> <RowDefinition Height="*"></RowDefinition>
@ -18,63 +191,61 @@
<ColumnDefinition Width="3*"></ColumnDefinition> <ColumnDefinition Width="3*"></ColumnDefinition>
<ColumnDefinition Width="2.5*"></ColumnDefinition> <ColumnDefinition Width="2.5*"></ColumnDefinition>
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<TextBlock Grid.Row="0" Grid.ColumnSpan="3" Text="Игры" HorizontalAlignment="Center" FontSize="20"/> <Rectangle Grid.Column="0" Grid.Row="0" Fill="Gold" Grid.RowSpan="1" ></Rectangle>
<StackPanel Grid.Row="1" Grid.Column="0" VerticalAlignment="Stretch"> <Rectangle Grid.Column="2" Grid.Row="0" Fill="Gold" Grid.RowSpan="1" ></Rectangle>
<Viewbox Margin="5"> <TextBlock Grid.Row="0" Grid.Column="1" Text="Игры" HorizontalAlignment="Center" FontSize="20"/>
<Image x:Name="pictureGame1" Source="C:\Users\shotb\source\repos\TSCHMI\project\Картинки\eldenring.jpg" /> <StackPanel Grid.Row="1" Grid.Column="0" VerticalAlignment="Stretch" Margin="0,0,0,15">
<Viewbox Margin="5">
<MediaElement x:Name="mediaElement" Grid.Column="0" Grid.Row="2" Grid.ColumnSpan="2" Grid.RowSpan="1" Margin="5, 0, 20, 0" Source="src\poe_necr.mp4" LoadedBehavior="Manual" UnloadedBehavior="Manual" />
<!--<Image x:Name="pictureGame1" Source="src\eldenring.jpg" />-->
</Viewbox> </Viewbox>
<Button x:Name="butGame1" Content="Add" Margin="5,0,5,0" HorizontalAlignment="Stretch"/> <Button x:Name="butGame1" Content="Path of Exile" Margin="5,0,5,0" HorizontalAlignment="Stretch" Height="30" Click="button_Click"/>
<TextBlock Text="Elden Ring" Margin="5" HorizontalAlignment="Center" FontSize="20"/> <DockPanel>
<TextBlock x:Name="cost1" Text="2100 р." Margin="5" HorizontalAlignment="Center" FontSize="15"/> <Button x:Name="butvidstart" Content="Start" Margin="5,2,2,0" Style="{StaticResource StartButtonStyle}" HorizontalAlignment="Left" Height="25" Width="108" Click="butvidstart_Click"/>
<Button x:Name="butvidstop" Content="Stop" Margin="5,2,2,0" Style="{StaticResource StopButtonStyle}" HorizontalAlignment="Left" Height="25" Width="108" Click="butvidstop_Click"/>
</DockPanel>
<TextBlock x:Name="cost1" Text="0 р." HorizontalAlignment="Center" FontSize="15"/>
</StackPanel> </StackPanel>
<StackPanel Grid.Row="1" Grid.Column="1" VerticalAlignment="Stretch"> <StackPanel Grid.Row="1" Grid.Column="1" VerticalAlignment="Stretch">
<Viewbox Margin="5"> <Viewbox Margin="5">
<Image x:Name="pictureGame2" Source="C:\Users\shotb\source\repos\TSCHMI\project\Картинки\terraria.jpg" /> <Image x:Name="pictureGame2" Source="src/terraria.jpg" />
</Viewbox> </Viewbox>
<Button x:Name="butGame2" Content="Add" Margin="5,0,5,0" HorizontalAlignment="Stretch"/> <Button x:Name="butGame2" Content="Terraria" Margin="5,0,5,0" HorizontalAlignment="Stretch" Height="30" Click="button_Click"/>
<TextBlock Text="Terraria" Margin="5" HorizontalAlignment="Center" FontSize="20"/>
<TextBlock x:Name="cost2" Text="210 р." Margin="5" HorizontalAlignment="Center" FontSize="15"/> <TextBlock x:Name="cost2" Text="210 р." Margin="5" HorizontalAlignment="Center" FontSize="15"/>
</StackPanel> </StackPanel>
<StackPanel Grid.Row="1" Grid.Column="2" VerticalAlignment="Stretch"> <StackPanel Grid.Row="1" Grid.Column="2" VerticalAlignment="Stretch">
<Viewbox Margin="5"> <Viewbox Margin="5">
<Image x:Name="pictureGame3" Source="C:\Users\shotb\source\repos\TSCHMI\project\Картинки\sekiro.jpg" /> <Image x:Name="pictureGame3" Source="src\sekiro.jpg" />
</Viewbox> </Viewbox>
<Button x:Name="butGame3" Content="Add" Margin="5,0,5,0" HorizontalAlignment="Stretch"/> <Button x:Name="butGame3" Content="Sekiro" Margin="5,0,5,0" HorizontalAlignment="Stretch" Height="30" Click="button_Click"/>
<TextBlock Text="Sekiro" Margin="5" HorizontalAlignment="Center" FontSize="20"/>
<TextBlock x:Name="cost3" Text="2300 р." Margin="5" HorizontalAlignment="Center" FontSize="15"/> <TextBlock x:Name="cost3" Text="2300 р." Margin="5" HorizontalAlignment="Center" FontSize="15"/>
</StackPanel> </StackPanel>
<StackPanel Grid.Row="2" Grid.Column="0" VerticalAlignment="Stretch"> <StackPanel Grid.Row="2" Grid.Column="0" VerticalAlignment="Stretch">
<Viewbox Margin="5"> <Viewbox Margin="5">
<Image x:Name="pictureGame4" Source="C:\Users\shotb\source\repos\TSCHMI\project\Картинки\risk-of-rain-returns.jpg" /> <Image x:Name="pictureGame4" Source="src\risk-of-rain-returns.jpg" />
</Viewbox> </Viewbox>
<Button x:Name="butGame4" Content="Add" Margin="5,0,5,0" HorizontalAlignment="Stretch"/> <Button x:Name="butGame4" Content="Risk of Rain" Margin="5,0,5,0" HorizontalAlignment="Stretch" Height="30" Click="button_Click"/>
<TextBlock Text="Risk of Rain" Margin="5" HorizontalAlignment="Center" FontSize="20"/>
<TextBlock x:Name="cost4" Text="700 р." Margin="5" HorizontalAlignment="Center" FontSize="15"/> <TextBlock x:Name="cost4" Text="700 р." Margin="5" HorizontalAlignment="Center" FontSize="15"/>
</StackPanel> </StackPanel>
<StackPanel Grid.Row="2" Grid.Column="1" VerticalAlignment="Stretch"> <StackPanel Grid.Row="2" Grid.Column="1" VerticalAlignment="Stretch">
<Viewbox Margin="5"> <Viewbox Margin="5">
<Image x:Name="pictureGame5" Source="C:\Users\shotb\source\repos\TSCHMI\project\Картинки\poe.jpg" /> <Image x:Name="pictureGame5" Source="src\eldenring.jpg" />
</Viewbox> </Viewbox>
<Button x:Name="butGame5" Content="Add" Margin="5,0,5,0" HorizontalAlignment="Stretch"/> <Button x:Name="butGame5" Content="Elden Ring" Margin="5,0,5,0" HorizontalAlignment="Stretch" Height="30" Click="button_Click"/>
<TextBlock Text="Path of Exile" Margin="5" HorizontalAlignment="Center" FontSize="20"/> <TextBlock x:Name="cost5" Text="2500 р." Margin="5" HorizontalAlignment="Center" FontSize="15"/>
<TextBlock x:Name="cost5" Text="500 р." Margin="5" HorizontalAlignment="Center" FontSize="15"/>
</StackPanel> </StackPanel>
<StackPanel Grid.Row="2" Grid.Column="2" VerticalAlignment="Stretch"> <StackPanel Grid.Row="2" Grid.Column="2" VerticalAlignment="Stretch">
<Viewbox Margin="5"> <Viewbox Margin="5">
<Image x:Name="pictureGame6" Source="C:\Users\shotb\source\repos\TSCHMI\project\Картинки\hoi5.jpg" /> <Image x:Name="pictureGame6" Source="src\hoi5.jpg" />
</Viewbox> </Viewbox>
<Button x:Name="butGame6" Content="Add" Margin="5,0,5,0" HorizontalAlignment="Stretch"/> <Button x:Name="butGame6" Content="Hearts of Iron 5" Margin="5,0,5,0" HorizontalAlignment="Stretch" Height="30" Click="button_Click"/>
<TextBlock Text="Hearts of Iron 5" Margin="5" HorizontalAlignment="Center" FontSize="20"/>
<TextBlock x:Name="cost6" Text="2100 р." Margin="5" HorizontalAlignment="Center" FontSize="15"/> <TextBlock x:Name="cost6" Text="2100 р." Margin="5" HorizontalAlignment="Center" FontSize="15"/>
</StackPanel> </StackPanel>
<TextBlock Grid.Row="0" Grid.Column="3" Text="Итог" HorizontalAlignment="Center" FontSize="20" /> <TextBlock Grid.Row="0" Grid.Column="3" Text="Итог" HorizontalAlignment="Center" FontSize="20" />
<StackPanel Grid.Row="1" Grid.RowSpan="2" Grid.Column="3"> <StackPanel Grid.Row="1" Grid.RowSpan="2" Grid.Column="3">
<ListView FontSize="20"> <StackPanel x:Name="stackView">
<TextBlock>Terraria</TextBlock>
<TextBlock>Sekiro</TextBlock> </StackPanel>
<TextBlock>Risk of Rain</TextBlock>
<TextBlock>Elden Ring</TextBlock>
</ListView>
<TextBlock Text="Сумма:----" FontSize="20"/> <TextBlock Text="Сумма:----" FontSize="20"/>
</StackPanel> </StackPanel>
</Grid> </Grid>

View File

@ -1,6 +1,8 @@
using System.Text; using System;
using System.Text;
using System.Windows; using System.Windows;
using System.Windows.Controls; using System.Windows.Controls;
using System.Windows.Controls.Primitives;
using System.Windows.Data; using System.Windows.Data;
using System.Windows.Documents; using System.Windows.Documents;
using System.Windows.Input; using System.Windows.Input;
@ -19,6 +21,31 @@ namespace project
public MainWindow() public MainWindow()
{ {
InitializeComponent(); InitializeComponent();
mediaElement.Play();
mediaElement.Stop();
}
private void butvidstart_Click(object sender, RoutedEventArgs e)
{
if (mediaElement.Source != null)
{
mediaElement.Volume = 0.03;
mediaElement.Play();
}
}
private void butvidstop_Click(object sender, RoutedEventArgs e)
{
if (mediaElement.CanPause)
{
mediaElement.Pause();
}
}
private void button_Click(object sender, RoutedEventArgs e)
{
var newTextBlock = new TextBlock();
newTextBlock.Text = e.Source.ToString()?.Remove(0,32);
newTextBlock.FontSize = 17;
stackView.Children.Add(newTextBlock);
} }
} }
} }

View File

@ -8,4 +8,26 @@
<UseWPF>true</UseWPF> <UseWPF>true</UseWPF>
</PropertyGroup> </PropertyGroup>
<ItemGroup>
<None Remove="src\eldenring.jpg" />
<None Remove="src\hoi5.jpg" />
<None Remove="src\poe.jpg" />
<None Remove="src\poe_necr.mp4" />
<None Remove="src\risk-of-rain-returns.jpg" />
<None Remove="src\sekiro.jpg" />
<None Remove="src\terraria.jpg" />
</ItemGroup>
<ItemGroup>
<Resource Include="src\eldenring.jpg" />
<Resource Include="src\hoi5.jpg" />
<Resource Include="src\poe.jpg" />
<EmbeddedResource Include="src\poe_necr.mp4">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</EmbeddedResource>
<Resource Include="src\risk-of-rain-returns.jpg" />
<Resource Include="src\sekiro.jpg" />
<Resource Include="src\terraria.jpg" />
</ItemGroup>
</Project> </Project>

View File

Before

Width:  |  Height:  |  Size: 38 KiB

After

Width:  |  Height:  |  Size: 38 KiB

View File

Before

Width:  |  Height:  |  Size: 273 KiB

After

Width:  |  Height:  |  Size: 273 KiB

View File

Before

Width:  |  Height:  |  Size: 122 KiB

After

Width:  |  Height:  |  Size: 122 KiB

Binary file not shown.

View File

Before

Width:  |  Height:  |  Size: 53 KiB

After

Width:  |  Height:  |  Size: 53 KiB

View File

Before

Width:  |  Height:  |  Size: 32 KiB

After

Width:  |  Height:  |  Size: 32 KiB

View File

Before

Width:  |  Height:  |  Size: 86 KiB

After

Width:  |  Height:  |  Size: 86 KiB