lab-4 finished

This commit is contained in:
Zakharov_Rostislav 2024-04-24 12:37:52 +04:00
commit c7d5649035
8 changed files with 45 additions and 25 deletions

View File

@ -8,11 +8,18 @@
</PropertyGroup>
<ItemGroup>
<None Remove="images\forest.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="images\forest.png" />
<Resource Include="Resources\images\desert.png">
<CopyToOutputDirectory>Never</CopyToOutputDirectory>
</Resource>
<Resource Include="Resources\images\forest.png">
<CopyToOutputDirectory>Never</CopyToOutputDirectory>
</Resource>
<Resource Include="Resources\images\sea.png">
<CopyToOutputDirectory>Never</CopyToOutputDirectory>
</Resource>
<Resource Include="Resources\images\sea2.png">
<CopyToOutputDirectory>Never</CopyToOutputDirectory>
</Resource>
</ItemGroup>
</Project>

View File

@ -6,6 +6,12 @@
xmlns:local="clr-namespace:Interfaces"
mc:Ignorable="d"
Title="SoundBox" Height="450" Width="800">
<Window.Resources>
<SolidColorBrush x:Key="ForestBackgroundColor" Color="Olive" />
<SolidColorBrush x:Key="DesertBackgroundColor" Color="LightSalmon" />
<SolidColorBrush x:Key="SeaBackgroundColor" Color="DarkCyan" />
</Window.Resources>
<Grid ShowGridLines="True">
<Window.Resources>
<SolidColorBrush x:Key="ButtonBackgroundColor" Color="Bisque" />
<Style TargetType="Button">
@ -35,25 +41,23 @@
<ScrollViewer CanContentScroll="True" VerticalScrollBarVisibility="Hidden">
<StackPanel Grid.Row="0" Grid.Column="0" HorizontalAlignment="Center"
VerticalAlignment="Stretch" Orientation="Vertical">
<Button Margin="10,5,10,5" Padding="3,3,3,3">Forest</Button>
<Button Margin="10,5,10,5" Padding="3,3,3,3">Desert</Button>
<Button Margin="10,5,10,5" Padding="3,3,3,3">Jungle</Button>
<Button Margin="10,5,10,5" Padding="3,3,3,3">Tundra</Button>
<Button Margin="10,5,10,5" Padding="3,3,3,3">Taiga</Button>
<Button Margin="10,5,10,5" Padding="3,3,3,3">Steppe</Button>
<Button Margin="10,5,10,5" Padding="3,3,3,3">Mountains</Button>
<Button Margin="10,5,10,5" Padding="3,3,3,3">Sea</Button>
<Button Margin="10,5,10,5" Padding="3,3,3,3" Click="ButtonForest_Click">Forest</Button>
<Button Margin="10,5,10,5" Padding="3,3,3,3" Click="ButtonDesert_Click">Desert</Button>
<Button Margin="10,5,10,5" Padding="3,3,3,3" Click="ButtonSea_Click">Sea</Button>
</StackPanel>
</ScrollViewer>
</Border>
<DockPanel Grid.Row="0" Grid.Column="1" Background="Olive">
<DockPanel Name="PanelMenu" Grid.Row="0" Grid.Column="1"
Background="{StaticResource SeaBackgroundColor}">
<StackPanel DockPanel.Dock="Bottom" Orientation="Horizontal"
HorizontalAlignment="Center" VerticalAlignment="Center">
<Button Margin="10,5,10,5" Padding="3,3,3,3">Execute</Button>
<Button Margin="10,5,10,5" Padding="3,3,3,3">Cancel</Button>
</StackPanel>
<DockPanel Background="Black">
<Image Source="images/forest.png"/>
<Viewbox>
<Image Name="ImageNature" Source="/Resources/images/sea.png"/>
</Viewbox>
</DockPanel>
</DockPanel>
</Grid>

View File

@ -1,17 +1,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
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 Interfaces
{
@ -24,5 +14,24 @@ namespace Interfaces
{
InitializeComponent();
}
private void ButtonDesert_Click(object sender, RoutedEventArgs e)
{
ImageNature.Source = new BitmapImage(new Uri("/Resources/images/desert.png", UriKind.Relative));
PanelMenu.Background = (Brush)TryFindResource("DesertBackgroundColor");
}
private void ButtonForest_Click(object sender, RoutedEventArgs e)
{
ImageNature.Source = new BitmapImage(new Uri("/Resources/images/forest.png", UriKind.Relative));
PanelMenu.Background = (Brush)TryFindResource("ForestBackgroundColor");
}
private void ButtonSea_Click(object sender, RoutedEventArgs e)
{
ImageNature.Source = new BitmapImage(new Uri("/Resources/images/sea.png", UriKind.Relative));
PanelMenu.Background = (Brush)TryFindResource("SeaBackgroundColor");
}
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1017 KiB

View File

Before

Width:  |  Height:  |  Size: 880 KiB

After

Width:  |  Height:  |  Size: 880 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 165 B