lab-3 finished

This commit is contained in:
Zakharov_Rostislav 2024-04-24 12:34:53 +04:00
parent 2db8be3335
commit 3b4f8bba61
5 changed files with 24 additions and 12 deletions

View File

@ -8,13 +8,16 @@
</PropertyGroup>
<ItemGroup>
<Resource Include="images\desert.png">
<Resource Include="Resources\images\desert.png">
<CopyToOutputDirectory>Never</CopyToOutputDirectory>
</Resource>
<Resource Include="images\desert2.png">
<Resource Include="Resources\images\forest.png">
<CopyToOutputDirectory>Never</CopyToOutputDirectory>
</Resource>
<Resource Include="images\forest.png">
<Resource Include="Resources\images\sea.png">
<CopyToOutputDirectory>Never</CopyToOutputDirectory>
</Resource>
<Resource Include="Resources\images\sea2.png">
<CopyToOutputDirectory>Never</CopyToOutputDirectory>
</Resource>
</ItemGroup>

View File

@ -6,7 +6,12 @@
xmlns:local="clr-namespace:Interfaces"
mc:Ignorable="d"
Title="SoundBox" Height="450" Width="800">
<Grid ShowGridLines="True">
<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">
<Grid.RowDefinitions>
<RowDefinition Height="*"></RowDefinition>
</Grid.RowDefinitions>
@ -21,16 +26,12 @@
VerticalAlignment="Stretch" Orientation="Vertical">
<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">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="ButtonSea_Click">Sea</Button>
</StackPanel>
</ScrollViewer>
</Border>
<DockPanel Name="PanelMenu" 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>
@ -38,7 +39,7 @@
</StackPanel>
<DockPanel Background="Black">
<Viewbox>
<Image Name="ImageNature" Source="/Resources/images/desert.png"/>
<Image Name="ImageNature" Source="/Resources/images/sea.png"/>
</Viewbox>
</DockPanel>
</DockPanel>

View File

@ -18,12 +18,20 @@ namespace Interfaces
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: 2.9 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 MiB