Compare commits

...

2 Commits
main ... Lab12

14 changed files with 395 additions and 0 deletions

25
project/project.sln Normal file
View File

@ -0,0 +1,25 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.9.34714.143
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "project", "project\project.csproj", "{1047D4CD-2042-4F56-957C-E270470DFAAA}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{1047D4CD-2042-4F56-957C-E270470DFAAA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{1047D4CD-2042-4F56-957C-E270470DFAAA}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1047D4CD-2042-4F56-957C-E270470DFAAA}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1047D4CD-2042-4F56-957C-E270470DFAAA}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {10CCA120-7172-4F83-A2A6-35ADC8170BD2}
EndGlobalSection
EndGlobal

9
project/project/App.xaml Normal file
View File

@ -0,0 +1,9 @@
<Application x:Class="project.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:project"
StartupUri="MainWindow.xaml">
<Application.Resources>
</Application.Resources>
</Application>

View File

@ -0,0 +1,14 @@
using System.Configuration;
using System.Data;
using System.Windows;
namespace project
{
/// <summary>
/// Interaction logic for App.xaml
/// </summary>
public partial class App : Application
{
}
}

View File

@ -0,0 +1,10 @@
using System.Windows;
[assembly: ThemeInfo(
ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
//(used if a resource is not found in the page,
// or application resource dictionaries)
ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
//(used if a resource is not found in the page,
// app, or any theme specific resource dictionaries)
)]

View File

@ -0,0 +1,253 @@
<Window x:Class="project.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
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:local="clr-namespace:project"
mc:Ignorable="d"
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.RowDefinitions>
<RowDefinition Height="*"></RowDefinition>
<RowDefinition Height="6*"></RowDefinition>
<RowDefinition Height="6*"></RowDefinition>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="3*"></ColumnDefinition>
<ColumnDefinition Width="3*"></ColumnDefinition>
<ColumnDefinition Width="3*"></ColumnDefinition>
<ColumnDefinition Width="2.5*"></ColumnDefinition>
</Grid.ColumnDefinitions>
<Rectangle Grid.Column="0" Grid.Row="0" Fill="Gold" Grid.RowSpan="1" ></Rectangle>
<Rectangle Grid.Column="2" Grid.Row="0" Fill="Gold" Grid.RowSpan="1" ></Rectangle>
<TextBlock Grid.Row="0" Grid.Column="1" Text="Игры" HorizontalAlignment="Center" FontSize="20"/>
<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>
<Button x:Name="butGame1" Content="Path of Exile" Margin="5,0,5,0" HorizontalAlignment="Stretch" Height="30" Click="button_Click"/>
<DockPanel>
<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 Grid.Row="1" Grid.Column="1" VerticalAlignment="Stretch">
<Viewbox Margin="5">
<Image x:Name="pictureGame2" Source="src/terraria.jpg" />
</Viewbox>
<Button x:Name="butGame2" Content="Terraria" Margin="5,0,5,0" HorizontalAlignment="Stretch" Height="30" Click="button_Click"/>
<TextBlock x:Name="cost2" Text="210 р." Margin="5" HorizontalAlignment="Center" FontSize="15"/>
</StackPanel>
<StackPanel Grid.Row="1" Grid.Column="2" VerticalAlignment="Stretch">
<Viewbox Margin="5">
<Image x:Name="pictureGame3" Source="src\sekiro.jpg" />
</Viewbox>
<Button x:Name="butGame3" Content="Sekiro" Margin="5,0,5,0" HorizontalAlignment="Stretch" Height="30" Click="button_Click"/>
<TextBlock x:Name="cost3" Text="2300 р." Margin="5" HorizontalAlignment="Center" FontSize="15"/>
</StackPanel>
<StackPanel Grid.Row="2" Grid.Column="0" VerticalAlignment="Stretch">
<Viewbox Margin="5">
<Image x:Name="pictureGame4" Source="src\risk-of-rain-returns.jpg" />
</Viewbox>
<Button x:Name="butGame4" Content="Risk of Rain" Margin="5,0,5,0" HorizontalAlignment="Stretch" Height="30" Click="button_Click"/>
<TextBlock x:Name="cost4" Text="700 р." Margin="5" HorizontalAlignment="Center" FontSize="15"/>
</StackPanel>
<StackPanel Grid.Row="2" Grid.Column="1" VerticalAlignment="Stretch">
<Viewbox Margin="5">
<Image x:Name="pictureGame5" Source="src\eldenring.jpg" />
</Viewbox>
<Button x:Name="butGame5" Content="Elden Ring" Margin="5,0,5,0" HorizontalAlignment="Stretch" Height="30" Click="button_Click"/>
<TextBlock x:Name="cost5" Text="2500 р." Margin="5" HorizontalAlignment="Center" FontSize="15"/>
</StackPanel>
<StackPanel Grid.Row="2" Grid.Column="2" VerticalAlignment="Stretch">
<Viewbox Margin="5">
<Image x:Name="pictureGame6" Source="src\hoi5.jpg" />
</Viewbox>
<Button x:Name="butGame6" Content="Hearts of Iron 5" Margin="5,0,5,0" HorizontalAlignment="Stretch" Height="30" Click="button_Click"/>
<TextBlock x:Name="cost6" Text="2100 р." Margin="5" HorizontalAlignment="Center" FontSize="15"/>
</StackPanel>
<TextBlock Grid.Row="0" Grid.Column="3" Text="Итог" HorizontalAlignment="Center" FontSize="20" />
<StackPanel Grid.Row="1" Grid.RowSpan="2" Grid.Column="3">
<StackPanel x:Name="stackView">
</StackPanel>
<TextBlock Text="Сумма:----" FontSize="20"/>
</StackPanel>
</Grid>
</Window>

View File

@ -0,0 +1,51 @@
using System;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Controls.Primitives;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
namespace project
{
/// <summary>
/// Interaction logic for MainWindow.xaml
/// </summary>
public partial class MainWindow : Window
{
public MainWindow()
{
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

@ -0,0 +1,33 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net8.0-windows</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<UseWPF>true</UseWPF>
</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>

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 273 KiB

BIN
project/project/src/poe.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 122 KiB

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 53 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 86 KiB