This commit is contained in:
Zakharov_Rostislav 2024-04-24 14:35:39 +04:00
parent ac1b47b546
commit 80351d2e2d
4 changed files with 20 additions and 5 deletions

View File

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

View File

@ -72,12 +72,14 @@
Background="{StaticResource SeaBackgroundColor}"> Background="{StaticResource SeaBackgroundColor}">
<StackPanel DockPanel.Dock="Bottom" Orientation="Horizontal" <StackPanel DockPanel.Dock="Bottom" Orientation="Horizontal"
HorizontalAlignment="Center" VerticalAlignment="Center"> HorizontalAlignment="Center" VerticalAlignment="Center">
<Button Name="ButtonExecute" Margin="10,5,10,5" Padding="3,3,3,3">Execute</Button> <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">Cancel</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"
Source="/Resources/sounds/forest.wav"/>
</StackPanel> </StackPanel>
<DockPanel Background="Black"> <DockPanel Background="Black">
<Viewbox> <Viewbox>
<Image Name="ImageNature" Source="/Resources/images/sea.png"/> <Image Name="ImageNature" Source="/Resources/images/sea2.png"/>
</Viewbox> </Viewbox>
</DockPanel> </DockPanel>
</DockPanel> </DockPanel>

View File

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

Binary file not shown.