Добавил попап
This commit is contained in:
parent
dd17348e45
commit
c32d1b3296
@ -24,6 +24,35 @@
|
||||
<SolidColorBrush
|
||||
x:Key="controlSolidBrush"
|
||||
Color="{StaticResource whiteColor}"/>
|
||||
<Style x:Key="ScaleOnMouse" TargetType="Image">
|
||||
<Setter Property="RenderTransformOrigin" Value="0.5,0.5"/>
|
||||
<Setter Property="Width" Value="{Binding ActualWidth}"/>
|
||||
<Setter Property="Height" Value="{Binding ActualHeight}"/>
|
||||
<Setter Property="RenderTransform">
|
||||
<Setter.Value>
|
||||
<ScaleTransform ScaleX="1" ScaleY="1"/>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
<Style.Triggers>
|
||||
<EventTrigger RoutedEvent="MouseEnter">
|
||||
<BeginStoryboard>
|
||||
<Storyboard>
|
||||
<DoubleAnimation Storyboard.TargetProperty="RenderTransform.ScaleX" To="0.9" Duration="0:0:0.3"/>
|
||||
<DoubleAnimation Storyboard.TargetProperty="RenderTransform.ScaleY" To="0.9" Duration="0:0:0.3"/>
|
||||
</Storyboard>
|
||||
</BeginStoryboard>
|
||||
</EventTrigger>
|
||||
<EventTrigger RoutedEvent="MouseLeave">
|
||||
<BeginStoryboard>
|
||||
<Storyboard>
|
||||
<DoubleAnimation Storyboard.TargetProperty="RenderTransform.ScaleX" To="1" Duration="0:0:0.3"/>
|
||||
<DoubleAnimation Storyboard.TargetProperty="RenderTransform.ScaleY" To="1" Duration="0:0:0.3"/>
|
||||
</Storyboard>
|
||||
</BeginStoryboard>
|
||||
</EventTrigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
|
||||
</Window.Resources>
|
||||
<Grid>
|
||||
<Grid.Background>
|
||||
@ -40,13 +69,19 @@
|
||||
</LinearGradientBrush>
|
||||
</DockPanel.Background>
|
||||
<ComboBox
|
||||
x:Name="ComboBoxAttractions"
|
||||
Height="24"
|
||||
Width="250"
|
||||
Margin="30, 0, 0, 0" SelectedIndex="0"
|
||||
Background="{StaticResource controlSolidBrush}">
|
||||
<ComboBoxItem Content="Выберите аттракцион"/>
|
||||
<ComboBoxItem Content="Болид"/>
|
||||
<ComboBoxItem Content="Цепная пила"/>
|
||||
<ComboBoxItem Content="Кораблекрушитель"/>
|
||||
<ComboBoxItem Content="Раскачатель"/>
|
||||
</ComboBox>
|
||||
<DatePicker
|
||||
x:Name="DatePicker"
|
||||
Width="120"
|
||||
Height="24"
|
||||
Margin="30, 0, 0, 0"
|
||||
@ -58,6 +93,7 @@
|
||||
VerticalContentAlignment="Center"
|
||||
/>
|
||||
<TextBox
|
||||
x:Name="TextBoxTicketCount"
|
||||
TextWrapping="Wrap"
|
||||
Width="50"
|
||||
Height="24"
|
||||
@ -71,6 +107,7 @@
|
||||
Width="100"
|
||||
Content="Купить билеты"
|
||||
Background="{StaticResource controlSolidBrush}"
|
||||
Click="ButtonBuyTicketsClick"
|
||||
/>
|
||||
</DockPanel>
|
||||
<DockPanel LastChildFill="False" HorizontalAlignment="Left" Width="100">
|
||||
@ -97,10 +134,10 @@
|
||||
<ColumnDefinition></ColumnDefinition>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Label Grid.Row="0" Grid.ColumnSpan="3" Content="Лучший парк развлечений!" HorizontalContentAlignment="Center" HorizontalAlignment="Stretch" VerticalAlignment="Top" FontSize="20" FontStyle="Oblique"/>
|
||||
<Image Source="static\images\american_gorki.jpg" Grid.Row="1" Grid.Column="0"/>
|
||||
<Image Source="static\images\cepnoy.jpg" Grid.Row="1" Grid.Column="1"/>
|
||||
<Image Source="static\images\kachel.jpg" Grid.Row="2" Grid.Column="0"/>
|
||||
<Image Source="static\images\korable.jpg" Grid.Row="2" Grid.Column="1"/>
|
||||
<Image Source="static\images\american_gorki.jpg" Grid.Row="1" Grid.Column="0" Style="{StaticResource ScaleOnMouse}" Stretch="Fill"/>
|
||||
<Image Source="static\images\cepnoy.jpg" Grid.Row="1" Grid.Column="1" Style="{StaticResource ScaleOnMouse}" Stretch="Fill"/>
|
||||
<Image Source="static\images\kachel.jpg" Grid.Row="2" Grid.Column="0" Style="{StaticResource ScaleOnMouse}" Stretch="Fill"/>
|
||||
<Image Source="static\images\korable.jpg" Grid.Row="2" Grid.Column="1" Style="{StaticResource ScaleOnMouse}" Stretch="Fill"/>
|
||||
</Grid>
|
||||
</ScrollViewer>
|
||||
</Grid>
|
||||
|
@ -11,5 +11,13 @@ namespace Lunapark
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
private void ButtonBuyTicketsClick(object sender, RoutedEventArgs e)
|
||||
{
|
||||
WindowBuyTickets windowBuyTickets = new WindowBuyTickets();
|
||||
windowBuyTickets.AttractionName.Content = $"аттаркцион \"{ComboBoxAttractions.Text}\"" ;
|
||||
windowBuyTickets.TicketsCount.Content = $"в количестве {TextBoxTicketCount.Text} штук";
|
||||
windowBuyTickets.LabelDate.Content = $"на {DatePicker.Text}";
|
||||
windowBuyTickets.Show();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
16
Lunapark/Lunapark/WindowBuyTickets.xaml
Normal file
16
Lunapark/Lunapark/WindowBuyTickets.xaml
Normal file
@ -0,0 +1,16 @@
|
||||
<Window x:Class="Lunapark.WindowBuyTickets"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:local="clr-namespace:Lunapark"
|
||||
mc:Ignorable="d"
|
||||
Title="Поздравляем!" Height="200" Width="300" Background="LightGreen">
|
||||
<Grid>
|
||||
<Label Content="Поздравляем!" HorizontalAlignment="Center" Margin="0,10,0,0" VerticalAlignment="Top"/>
|
||||
<Label Content="Вы купили билеты на" HorizontalAlignment="Center" Margin="0,41,0,0" VerticalAlignment="Top"/>
|
||||
<Label x:Name="AttractionName" Content="AttractionName" HorizontalAlignment="Center" VerticalAlignment="Top" Margin="0,72,0,0"/>
|
||||
<Label x:Name="TicketsCount" Content="Count" HorizontalAlignment="Center" Margin="0,103,0,0" VerticalAlignment="Top"/>
|
||||
<Label x:Name="LabelDate" Content="Label" HorizontalAlignment="Center" Margin="0,134,0,0" VerticalAlignment="Top"/>
|
||||
</Grid>
|
||||
</Window>
|
27
Lunapark/Lunapark/WindowBuyTickets.xaml.cs
Normal file
27
Lunapark/Lunapark/WindowBuyTickets.xaml.cs
Normal file
@ -0,0 +1,27 @@
|
||||
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.Shapes;
|
||||
|
||||
namespace Lunapark
|
||||
{
|
||||
/// <summary>
|
||||
/// Логика взаимодействия для WindowBuyTickets.xaml
|
||||
/// </summary>
|
||||
public partial class WindowBuyTickets : Window
|
||||
{
|
||||
public WindowBuyTickets()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user