12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152 |
- <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="1000" d:DesignHeight="450"
- xmlns:views="using:AvaloniaApplicationTest.Views"
- xmlns:vm="using:AvaloniaApplicationTest.ViewModels"
- x:DataType="vm:MainWindowViewModel"
- x:Class="AvaloniaApplicationTest.Views.ShowHotelsPage">
- <Grid>
- <ScrollViewer>
- <StackPanel>
- <Button Command="{Binding ToTours}" Content="Назад" HorizontalAlignment="Left" Margin="10"/>
- <TextBlock Text="Отели" HorizontalAlignment="Center" FontSize="20" Margin="0,0,20,0"/>
- <TextBlock Text="{Binding PageHotels.HowManyShow}" Margin="10"/>
- <StackPanel Orientation="Horizontal">
- <TextBox Margin="15,5,0,0" Width="8" HorizontalAlignment="Left" Text="{Binding PageHotels.UserCount}"/>
- <Button Command="{Binding ToAdd}" Content="Добавить отель" Margin="30,10,10,10"/>
- </StackPanel>
- <ListBox ItemsSource="{Binding PageHotels.LBHotels}">
- <ListBox.ItemsPanel>
- <ItemsPanelTemplate>
- <WrapPanel HorizontalAlignment="Center"/>
- </ItemsPanelTemplate>
- </ListBox.ItemsPanel>
- <ListBox.ItemTemplate>
- <DataTemplate>
- <Border BorderBrush="#fac716" BorderThickness="1">
- <StackPanel Width="500" Height="200">
- <TextBlock Text="{Binding Name, StringFormat=Название отеля: {0}}" Margin="5"/>
- <TextBlock Text="{Binding Stars}" Margin="10"/>
- <TextBlock Text="{Binding CountryName, StringFormat=Страна: {0}}" Margin="5"/>
- <TextBlock Text="{Binding CountTours, StringFormat=Количество туров: {0}}" Margin="5"/>
- <StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Margin="10">
- <Button Command="{Binding $parent[Window].((vm:MainWindowViewModel)DataContext).ToChange}" CommandParameter="{Binding Id}" Margin="0,10,0,0" Width="100" Content="Изменить" HorizontalAlignment="Right"/>
- <Button Command="{Binding $parent[Window].((vm:MainWindowViewModel)DataContext).DeleteHotel}" CommandParameter="{Binding Id}" Margin="0,10,0,0" Width="100" Content="Удалить" HorizontalAlignment="Right"/>
- </StackPanel>
- </StackPanel>
- </Border>
- </DataTemplate>
- </ListBox.ItemTemplate>
- </ListBox>
- <StackPanel Orientation="Horizontal" Margin="10" HorizontalAlignment="Center">
- <Button Command="{Binding PageHotels.Back}" IsEnabled="{Binding PageHotels.CanBack}" Content="Назад" Width="100"/>
- <TextBlock Margin="100,0,100,0" Text="{Binding PageHotels.PageNumber, StringFormat=Страница {0}}"/>
- <Button Command="{Binding PageHotels.Next}" IsEnabled="{Binding PageHotels.CanNext}" Content="Вперед" Width="100"/>
- </StackPanel>
- </StackPanel>
- </ScrollViewer>
- </Grid>
- </UserControl>
|