AddPage.axaml 1.8 KB

123456789101112131415161718192021222324252627282930313233343536
  1. <UserControl xmlns="https://github.com/avaloniaui"
  2. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  3. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  4. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  5. xmlns:views="using:AvaloniaApplicationTest.Views"
  6. xmlns:vm="using:AvaloniaApplicationTest.ViewModels"
  7. x:DataType="vm:MainWindowViewModel"
  8. mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
  9. x:Class="AvaloniaApplicationTest.Views.AddPage">
  10. <Grid>
  11. <StackPanel>
  12. <Button Command="{Binding ToHotels}" Content="Назад" HorizontalAlignment="Left" Margin="10"/>
  13. <StackPanel Margin="20">
  14. <TextBlock Text="Название отеля"/>
  15. <TextBox Text="{Binding PageAdd.Name}" Width="200" HorizontalAlignment="Left"/>
  16. <TextBlock Text="Описание" Margin="0,20,0,0"/>
  17. <TextBox Text="{Binding PageAdd.Description}" Width="200" HorizontalAlignment="Left"/>
  18. <TextBlock Text="Количество звезд" Margin="0,20,0,0"/>
  19. <TextBox Text="{Binding PageAdd.CountOfStars}" Width="10" HorizontalAlignment="Left"/>
  20. <TextBlock Text="Страна" Margin="0,20,0,0"/>
  21. <ComboBox ItemsSource="{Binding PageAdd.CBContries}" Width="200" HorizontalAlignment="Left">
  22. <ComboBox.ItemTemplate>
  23. <DataTemplate>
  24. <TextBlock Text="{Binding Name}"/>
  25. </DataTemplate>
  26. </ComboBox.ItemTemplate>
  27. </ComboBox>
  28. <StackPanel Orientation="Horizontal" Margin="10">
  29. <Button Content="Сохранить" Command="{Binding PageAdd.Save}" Margin="0,0,15,0"/>
  30. <Button Content="Отмена" Command="{Binding ToHotels}"/>
  31. </StackPanel>
  32. <TextBlock Margin="10" Text="{Binding PageAdd.Message}" Foreground="#e31e24"/>
  33. </StackPanel>
  34. </StackPanel>
  35. </Grid>
  36. </UserControl>