123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869 |
- <UserControl xmlns="https://github.com/avaloniaui"
- 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"
- mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
- x:Class="travel.Views.HotelPage"
- xmlns:vm="using:travel.ViewModels"
- x:DataType="vm:MainWindowViewModel">
- <Grid>
- <Grid.RowDefinitions>
- <RowDefinition Height="0.2*"/>
- <RowDefinition/>
- <RowDefinition Height="0.3*"/>
- </Grid.RowDefinitions>
- <StackPanel Orientation="Vertical">
- <StackPanel Orientation="Horizontal" Margin="5,10">
- <TextBlock Text="Количество элементов: " VerticalAlignment="Center"/>
- <TextBox Text="{Binding hp_VM.CountElem}" MaxHeight="10"/>
- </StackPanel>
- <Button Content="Туры" Margin="10" Command="{Binding GoPageTour}"/>
- </StackPanel>
- <StackPanel Grid.Row="1">
- <Button Content="Добавить" Margin="5" Command="{Binding GoHotelCard}" HorizontalAlignment="Right" Background="#bae3e8"/>
- <Button Content="Удалить" Margin="5" Command="{Binding GoPageTour}" HorizontalAlignment="Right" Background="#e31e24"/>
- </StackPanel>
- <ListBox ItemsSource="{Binding hp_VM.ListHotels}" Grid.Row="1" Margin="100,0">
- <ListBox.ItemsPanel>
- <ItemsPanelTemplate>
- <WrapPanel HorizontalAlignment="Center"/>
- </ItemsPanelTemplate>
- </ListBox.ItemsPanel>
- <ListBox.ItemTemplate>
- <DataTemplate>
- <Border CornerRadius="5" BorderBrush="Black" BorderThickness="2" Padding="10">
- <StackPanel Width="200" >
- <TextBlock Text="{Binding Name}" TextWrapping="Wrap"/>
- <TextBlock Text="{Binding StarString}" Foreground="#fac716"/>
- <TextBlock Text="{Binding CountryHotel}"/>
- <TextBlock Text="{Binding CountTour, StringFormat=Количество туров: {0}}"/>
- <Button Content="Изменить" Command="{Binding $parent[Window].((vm:MainWindowViewModel)DataContext).GoHotelCardChange}" CommandParameter="{Binding Id}" Background="#bae3e8"/>
- </StackPanel>
- </Border>
- </DataTemplate>
- </ListBox.ItemTemplate>
- </ListBox>
- <StackPanel Grid.Row="2">
- <Grid>
- <Grid.ColumnDefinitions>
- <ColumnDefinition/>
- <ColumnDefinition/>
- <ColumnDefinition/>
- </Grid.ColumnDefinitions>
- <StackPanel Orientation="Horizontal" Margin="5,25">
- <Button Content="<<" Command="{Binding hp_VM.Start}" Background="#878787"/>
- <Button Content="<" Margin="15,0" Command="{Binding hp_VM.Back}" Background="#878787"/>
- </StackPanel>
- <StackPanel Orientation="Horizontal" Margin="5,25" Grid.Column="2" HorizontalAlignment="Right">
- <Button Content=">" Margin="15,0" Command="{Binding hp_VM.Next}" Background="#878787"/>
- <Button Content=">>" Command="{Binding hp_VM.End}" Background="#878787"/>
- </StackPanel>
- <StackPanel Orientation="Horizontal" Grid.Column="1" HorizontalAlignment="Center" VerticalAlignment="Center">
- <TextBlock Text="{Binding hp_VM.T1}"/>
- <TextBlock Text=" / "/>
- <TextBlock Text="{Binding hp_VM.T2}"/>
- </StackPanel>
- </Grid>
- </StackPanel>
- </Grid>
- </UserControl>
|