This commit is contained in:
Zakharov_Rostislav 2024-05-02 22:30:08 +04:00
parent 80351d2e2d
commit 5faf618870
5 changed files with 14 additions and 30 deletions

View File

@ -20,9 +20,15 @@
<Resource Include="Resources\images\sea2.png">
<CopyToOutputDirectory>Never</CopyToOutputDirectory>
</Resource>
<Resource Include="Resources\sounds\desert.wav">
<CopyToOutputDirectory>Never</CopyToOutputDirectory>
</Resource>
<Resource Include="Resources\sounds\forest.wav">
<CopyToOutputDirectory>Never</CopyToOutputDirectory>
</Resource>
<Resource Include="Resources\sounds\sea.wav">
<CopyToOutputDirectory>Never</CopyToOutputDirectory>
</Resource>
</ItemGroup>
</Project>

View File

@ -6,30 +6,6 @@
xmlns:local="clr-namespace:Interfaces"
mc:Ignorable="d"
Title="SoundBox" Height="450" Width="800">
<Window.Triggers>
<EventTrigger RoutedEvent="Loaded">
<EventTrigger.Actions>
<BeginStoryboard>
<Storyboard TargetProperty="Width" TargetName="ButtonExecute">
<DoubleAnimation From="110"
To="200"
Duration="0:0:2"
AutoReverse="True"
RepeatBehavior="Forever"/>
</Storyboard>
</BeginStoryboard>
<BeginStoryboard>
<Storyboard TargetProperty="Width" TargetName="ButtonCancel">
<DoubleAnimation From="200"
To="110"
Duration="0:0:2"
AutoReverse="True"
RepeatBehavior="Forever"/>
</Storyboard>
</BeginStoryboard>
</EventTrigger.Actions>
</EventTrigger>
</Window.Triggers>
<Window.Resources>
<SolidColorBrush x:Key="ForestBackgroundColor" Color="Olive" />
<SolidColorBrush x:Key="DesertBackgroundColor" Color="LightSalmon" />
@ -72,14 +48,16 @@
Background="{StaticResource SeaBackgroundColor}">
<StackPanel DockPanel.Dock="Bottom" Orientation="Horizontal"
HorizontalAlignment="Center" VerticalAlignment="Center">
<Button Name="ButtonExecute" Margin="10,5,10,5" Padding="3,3,3,3" Click="ButtonExecute_Click">Execute</Button>
<Button Name="ButtonCancel" Margin="10,5,10,5" Padding="3,3,3,3" Click="ButtonCancel_Click">Cancel</Button>
<MediaElement Name="Sound" LoadedBehavior="Manual" UnloadedBehavior="Close"
<Button Name="ButtonExecute" Margin="10,5,10,5" Padding="3,3,3,3"
Click="ButtonExecute_Click">Execute</Button>
<Button Name="ButtonCancel" Margin="10,5,10,5" Padding="3,3,3,3"
Click="ButtonCancel_Click">Cancel</Button>
<MediaElement Name="Sound" LoadedBehavior="Play" UnloadedBehavior="Close"
Source="/Resources/sounds/forest.wav"/>
</StackPanel>
<DockPanel Background="Black">
<Viewbox>
<Image Name="ImageNature" Source="/Resources/images/sea2.png"/>
<Image Name="ImageNature" Source="/Resources/images/forest.png"/>
</Viewbox>
</DockPanel>
</DockPanel>

View File

@ -30,7 +30,7 @@ namespace Interfaces
private void ButtonSea_Click(object sender, RoutedEventArgs e)
{
ImageNature.Source = new BitmapImage(new Uri("/Resources/images/sea2.png", UriKind.Relative));
ImageNature.Source = new BitmapImage(new Uri("/Resources/images/sea.png", UriKind.Relative));
PanelMenu.Background = (Brush)TryFindResource("SeaBackgroundColor");
}

Binary file not shown.

Binary file not shown.