+ Лабараторная 5 и 6
This commit is contained in:
parent
cc7f8416bc
commit
db3cd55efd
@ -15,7 +15,7 @@
|
|||||||
<Setter Property="FontSize" Value="18"/>
|
<Setter Property="FontSize" Value="18"/>
|
||||||
<Setter Property="Margin" Value="20"/>
|
<Setter Property="Margin" Value="20"/>
|
||||||
</Style>
|
</Style>
|
||||||
|
|
||||||
<Style x:Key="checkboxStyle" TargetType="CheckBox">
|
<Style x:Key="checkboxStyle" TargetType="CheckBox">
|
||||||
<Setter Property="FontSize" Value="14"/>
|
<Setter Property="FontSize" Value="14"/>
|
||||||
<Style.Triggers>
|
<Style.Triggers>
|
||||||
@ -46,8 +46,77 @@
|
|||||||
<CheckBox Style="{StaticResource checkboxStyle}" Margin="10" Content="Я согласен на обработку данных"/>
|
<CheckBox Style="{StaticResource checkboxStyle}" Margin="10" Content="Я согласен на обработку данных"/>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
|
|
||||||
<Button Style="{StaticResource buttonDesicion}" Background="{StaticResource BrushWheat}" MinHeight="50" MinWidth="50" Grid.Row="3" Grid.Column="1">Принять</Button>
|
<Button x:Name="shakingbutton" Style="{StaticResource buttonDesicion}" Background="{StaticResource BrushWheat}" MinHeight="50" MinWidth="50" Grid.Row="3" Grid.Column="1" Content="Установить">
|
||||||
<Button Style="{StaticResource buttonDesicion}" Background="{StaticResource BrushWheat}" MinHeight="50" MinWidth="50" Grid.Row="3" Grid.Column="2">Отмена</Button>
|
<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"/>
|
<Label Content="Установка" Grid.Row="0" Grid.Column="0" FontSize="20" HorizontalAlignment="Center" VerticalAlignment="Center"/>
|
||||||
|
|
||||||
@ -64,5 +133,7 @@
|
|||||||
|
|
||||||
<Image Grid.Row="0" Grid.Column="1" Grid.ColumnSpan="2" Source="images/hgvstrgtavc.png" Stretch="Fill" Margin="0,10"/>
|
<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>
|
</Grid>
|
||||||
</Window>
|
</Window>
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
using System.Text;
|
using System.Media;
|
||||||
|
using System.Text;
|
||||||
using System.Windows;
|
using System.Windows;
|
||||||
using System.Windows.Controls;
|
using System.Windows.Controls;
|
||||||
using System.Windows.Data;
|
using System.Windows.Data;
|
||||||
@ -16,43 +17,13 @@ namespace WPF
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public partial class MainWindow : Window
|
public partial class MainWindow : Window
|
||||||
{
|
{
|
||||||
public ICommand ShowMessageBox { get; set; }
|
|
||||||
public MainWindow()
|
public MainWindow()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
ShowMessageBox = new RelayCommand(LoginShowBox);
|
|
||||||
DataContext = this;
|
|
||||||
}
|
}
|
||||||
private void LoginShowBox(object parameter)
|
private void LoginShowBox(object parameter)
|
||||||
{
|
{
|
||||||
MessageBox.Show("Вход");
|
MessageBox.Show("Вход");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public class RelayCommand : ICommand
|
|
||||||
{
|
|
||||||
private readonly Action<object> _execute;
|
|
||||||
private readonly Func<object, bool> _canExecute;
|
|
||||||
|
|
||||||
public RelayCommand(Action<object> execute, Func<object, bool> canExecute = null)
|
|
||||||
{
|
|
||||||
_execute = execute;
|
|
||||||
_canExecute = canExecute;
|
|
||||||
}
|
|
||||||
|
|
||||||
public bool CanExecute(object parameter)
|
|
||||||
{
|
|
||||||
return _canExecute == null || _canExecute(parameter);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void Execute(object parameter)
|
|
||||||
{
|
|
||||||
_execute(parameter);
|
|
||||||
}
|
|
||||||
|
|
||||||
public event EventHandler CanExecuteChanged
|
|
||||||
{
|
|
||||||
add { CommandManager.RequerySuggested += value; }
|
|
||||||
remove { CommandManager.RequerySuggested -= value; }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
@ -10,12 +10,23 @@
|
|||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<None Remove="images\hgvstrgtavc.png" />
|
<None Remove="images\hgvstrgtavc.png" />
|
||||||
|
<None Remove="sounds\button_cancel.wav" />
|
||||||
|
<None Remove="videos\pixel_loading_bar.mp4" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Resource Include="images\hgvstrgtavc.png">
|
<Resource Include="images\hgvstrgtavc.png">
|
||||||
<CopyToOutputDirectory>Never</CopyToOutputDirectory>
|
<CopyToOutputDirectory>Never</CopyToOutputDirectory>
|
||||||
</Resource>
|
</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>
|
</ItemGroup>
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
|
BIN
WPF/sounds/button_cancel.wav
Normal file
BIN
WPF/sounds/button_cancel.wav
Normal file
Binary file not shown.
BIN
WPF/videos/pixel_loading_bar.mp4
Normal file
BIN
WPF/videos/pixel_loading_bar.mp4
Normal file
Binary file not shown.
Loading…
Reference in New Issue
Block a user