Compare commits

...

No commits in common. "main" and "LabWork04" have entirely different histories.

12 changed files with 260 additions and 4 deletions

2
.gitignore vendored
View File

@ -1,4 +1,3 @@
# ---> VisualStudio
## Ignore Visual Studio temporary files, build results, and ## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons. ## files generated by popular Visual Studio add-ons.
## ##
@ -397,4 +396,3 @@ FodyWeavers.xsd
# JetBrains Rider # JetBrains Rider
*.sln.iml *.sln.iml

View File

@ -1,2 +1,2 @@
# WPF # WPFLabWork
In usual work with interface

9
WPF/App.xaml Normal file
View File

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

14
WPF/App.xaml.cs Normal file
View File

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

10
WPF/AssemblyInfo.cs Normal file
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)
)]

139
WPF/MainWindow.xaml Normal file
View File

@ -0,0 +1,139 @@
<Window x:Class="WPF.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:WPF"
mc:Ignorable="d"
Title="MainWindow" Height="500" Width="800" MinHeight="450" MinWidth="600" Background="LightYellow">
<Window.Resources>
<SolidColorBrush x:Key="BrushBlack" Color="Black"/>
<SolidColorBrush x:Key="BrushWheat" Color="Wheat"/>
<Style x:Key="buttonDesicion" TargetType="Button">
<Setter Property="FontSize" Value="18"/>
<Setter Property="Margin" Value="20"/>
</Style>
<Style x:Key="checkboxStyle" TargetType="CheckBox">
<Setter Property="FontSize" Value="14"/>
<Style.Triggers>
<Trigger Property="IsChecked" Value="True">
<Setter Property="Background" Value="Green"/>
<Setter Property="FontWeight" Value="Bold"/>
</Trigger>
</Style.Triggers>
</Style>
</Window.Resources>
<Grid ShowGridLines="True" Margin="0,0,0,0">
<Grid.RowDefinitions>
<RowDefinition Height="*"></RowDefinition>
<RowDefinition Height="2*"></RowDefinition>
<RowDefinition Height="*"></RowDefinition>
<RowDefinition Height="*"></RowDefinition>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition></ColumnDefinition>
<ColumnDefinition></ColumnDefinition>
<ColumnDefinition></ColumnDefinition>
</Grid.ColumnDefinitions>
<StackPanel Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="2" Orientation="Vertical">
<CheckBox Style="{StaticResource checkboxStyle}" Margin="10" Content=" Я согласен с пользовательским соглашением"/>
<CheckBox Style="{StaticResource checkboxStyle}" Margin="10" Content="Я согласен на обработку данных"/>
</StackPanel>
<Button x:Name="shakingbutton" Style="{StaticResource buttonDesicion}" Background="{StaticResource BrushWheat}" MinHeight="50" MinWidth="50" Grid.Row="3" Grid.Column="1" Content="Установить">
<Button.RenderTransform>
<TranslateTransform/>
</Button.RenderTransform>
<Button.Triggers>
<EventTrigger RoutedEvent="MouseEnter">
<BeginStoryboard Name="MouseEnter_BeginStoryboard">
<Storyboard>
<DoubleAnimationUsingKeyFrames RepeatBehavior="Forever" Storyboard.TargetProperty="RenderTransform.(TranslateTransform.Y)">
<SplineDoubleKeyFrame KeyTime="0:0:0" Value="0" />
<SplineDoubleKeyFrame KeyTime="0:0:0.50" Value="-5" />
<SplineDoubleKeyFrame KeyTime="0:0:1" Value="0" />
<SplineDoubleKeyFrame KeyTime="0:0:1.50" Value="5" />
<SplineDoubleKeyFrame KeyTime="0:0:2" Value="0" />
</DoubleAnimationUsingKeyFrames>
<ColorAnimation Storyboard.TargetName="shakingbutton"
Storyboard.TargetProperty="(Button.Foreground).(SolidColorBrush.Color)"
To="Green"
Duration="0:0:0.1"/>
</Storyboard>
</BeginStoryboard>
</EventTrigger>
<EventTrigger RoutedEvent="MouseLeave">
<StopStoryboard BeginStoryboardName="MouseEnter_BeginStoryboard"/>
</EventTrigger>
</Button.Triggers>
</Button>
<Button x:Name="cancelbutton" Background="{StaticResource BrushWheat}" MinHeight="50" MinWidth="50" Grid.Row="3" Grid.Column="2" Content="Отмена" FontSize="18" Margin="20">
<Button.RenderTransform>
<TranslateTransform/>
</Button.RenderTransform>
<Button.Triggers>
<EventTrigger RoutedEvent="MouseEnter">
<BeginStoryboard>
<Storyboard>
<DoubleAnimationUsingKeyFrames RepeatBehavior="Forever" Storyboard.TargetProperty="RenderTransform.(TranslateTransform.Y)">
<SplineDoubleKeyFrame KeyTime="0:0:0" Value="0" />
<SplineDoubleKeyFrame KeyTime="0:0:0.50" Value="-5" />
<SplineDoubleKeyFrame KeyTime="0:0:1" Value="0" />
<SplineDoubleKeyFrame KeyTime="0:0:1.50" Value="5" />
<SplineDoubleKeyFrame KeyTime="0:0:2" Value="0" />
</DoubleAnimationUsingKeyFrames>
<ColorAnimation Storyboard.TargetName="shakingbutton"
Storyboard.TargetProperty="(Button.Foreground).(SolidColorBrush.Color)"
To="Green"
Duration="0:0:0.1"/>
</Storyboard>
</BeginStoryboard>
</EventTrigger>
<EventTrigger RoutedEvent="MouseLeave">
<StopStoryboard BeginStoryboardName="MouseEnter_BeginStoryboard"/>
</EventTrigger>
</Button.Triggers>
<Button.Style>
<Style>
<Style.Triggers>
<EventTrigger RoutedEvent="Button.Click">
<EventTrigger.Actions>
<SoundPlayerAction Source="sounds/button_cancel.wav"></SoundPlayerAction>
</EventTrigger.Actions>
</EventTrigger>
</Style.Triggers>
</Style>
</Button.Style>
</Button>
<Label Content="Установка" Grid.Row="0" Grid.Column="0" FontSize="20" HorizontalAlignment="Center" VerticalAlignment="Center"/>
<RichTextBox Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="3" Margin="20" FontSize="20">
<FlowDocument>
<Paragraph>
<Run>Путь установки: C:\Users\Ilyas\AppData\Local\hgv</Run>
</Paragraph>
<Paragraph>
<Run>Требуемого места: 148Т</Run>
</Paragraph>
</FlowDocument>
</RichTextBox>
<Image Grid.Row="0" Grid.Column="1" Grid.ColumnSpan="2" Source="images/hgvstrgtavc.png" Stretch="Fill" Margin="0,10"/>
<MediaElement Source="videos/pixel_loading_bar.mp4" LoadedBehavior="Play" Grid.Row="3" Grid.Column="0" Margin="14,10,265,10" Grid.ColumnSpan="2"/>
</Grid>
</Window>

29
WPF/MainWindow.xaml.cs Normal file
View File

@ -0,0 +1,29 @@
using System.Media;
using System.Text;
using System.Windows;
using System.Windows.Controls;
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 WPF
{
/// <summary>
/// Interaction logic for MainWindow.xaml
/// </summary>
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
}
private void LoginShowBox(object parameter)
{
MessageBox.Show("Вход");
}
}
}

32
WPF/WPF.csproj Normal file
View File

@ -0,0 +1,32 @@
<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="images\hgvstrgtavc.png" />
<None Remove="sounds\button_cancel.wav" />
<None Remove="videos\pixel_loading_bar.mp4" />
</ItemGroup>
<ItemGroup>
<Resource Include="images\hgvstrgtavc.png">
<CopyToOutputDirectory>Never</CopyToOutputDirectory>
</Resource>
<Content Include="videos\pixel_loading_bar.mp4">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
</ItemGroup>
<ItemGroup>
<Content Include="sounds\button_cancel.wav">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
</ItemGroup>
</Project>

25
WPF/WPF.sln Normal file
View File

@ -0,0 +1,25 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.10.35013.160
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WPF", "WPF.csproj", "{5984A5DF-5C63-4910-B2A2-0697590DDF3D}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{5984A5DF-5C63-4910-B2A2-0697590DDF3D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{5984A5DF-5C63-4910-B2A2-0697590DDF3D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{5984A5DF-5C63-4910-B2A2-0697590DDF3D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{5984A5DF-5C63-4910-B2A2-0697590DDF3D}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {A01BF2B4-D42A-467A-9393-D884AF43EC42}
EndGlobalSection
EndGlobal

BIN
WPF/images/hgvstrgtavc.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Binary file not shown.