HomeView.axaml 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  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. mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
  6. xmlns:vm="clr-namespace:ApplicationAvalonia.ViewModels"
  7. x:DataType="vm:HomeViewModel"
  8. x:Class="ApplicationAvalonia.Views.HomeView"
  9. x:Name="root"
  10. xmlns:asyncImageLoader="clr-namespace:AsyncImageLoader;assembly=AsyncImageLoader.Avalonia"
  11. >
  12. <Grid RowDefinitions="80, *">
  13. <DockPanel LastChildFill="False" VerticalAlignment="Center" >
  14. <Image Source="/Assets/knpsb2_157dafdc.jpg" Height="100"/>
  15. <Button Content="Личный кабинет" FontSize="12" Command="{Binding GoToPersonalCabinetCommand}"
  16. DockPanel.Dock="Right" Margin="0 0 20 0"/>
  17. </DockPanel>
  18. <Border Grid.Row="1">
  19. <Grid ColumnDefinitions="300, *">
  20. <Border Grid.Column="0" CornerRadius="30" Background="#141414"
  21. Padding="30">
  22. <Grid RowDefinitions="80, *">
  23. <TextBox Width="200" Grid.Row="0" HorizontalAlignment="Center" VerticalAlignment="Center"
  24. Watermark="Найти фильм" Text="{Binding TextSearch}"/>
  25. <ListBox ItemsSource="{Binding Genres}" Grid.Row="1" Background="#141414" >
  26. <ListBox.ItemsPanel>
  27. <ItemsPanelTemplate>
  28. <WrapPanel HorizontalAlignment="Center" VerticalAlignment="Center"
  29. ItemHeight="60" Orientation="Horizontal"/>
  30. </ItemsPanelTemplate>
  31. </ListBox.ItemsPanel>
  32. <ListBox.ItemTemplate>
  33. <DataTemplate>
  34. <ToggleButton Content="{Binding GenreName}" Padding="10 5"
  35. Checked="ToggleButton_Checked_1" Unchecked="ToggleButton_Unchecked_2"
  36. Command="{Binding #root.((vm:HomeViewModel)DataContext).CallCategoryCommand}"
  37. CommandParameter="{Binding Id}" />
  38. </DataTemplate>
  39. </ListBox.ItemTemplate>
  40. </ListBox>
  41. </Grid>
  42. </Border>
  43. <ListBox Grid.Column="1" ItemsSource="{Binding ListFilms}" Background="#211F1F" >
  44. <ListBox.ItemsPanel>
  45. <ItemsPanelTemplate>
  46. <WrapPanel HorizontalAlignment="Center" VerticalAlignment="Center" />
  47. </ItemsPanelTemplate>
  48. </ListBox.ItemsPanel>
  49. <ListBox.ItemTemplate >
  50. <DataTemplate>
  51. <Border CornerRadius="10" MaxWidth="450" MinWidth="300"
  52. MinHeight="400" MaxHeight="400" Background="#4B4B4B"
  53. Padding="20">
  54. <StackPanel Orientation="Vertical">
  55. <Image asyncImageLoader:ImageLoader.Source="{Binding Image}"
  56. MaxHeight="200" MaxWidth="250" />
  57. <TextBlock Text="{Binding Name}"
  58. Margin="0 10" HorizontalAlignment="Center" />
  59. <TextBlock Text="{Binding Duration, StringFormat=Продолжительность: {0}}" Margin="0 10" />
  60. <TextBlock Text="{Binding Raiting, StringFormat=Рейтинг: {0}}" Margin="0 10" />
  61. <Button Command="{Binding #root.((vm:HomeViewModel)DataContext).FilmInfoCommand}"
  62. CommandParameter="{Binding Id}" HorizontalAlignment="Center"
  63. Content="Подробнее" Foreground="White" Background="Black"/>
  64. </StackPanel>
  65. </Border>
  66. </DataTemplate>
  67. </ListBox.ItemTemplate>
  68. </ListBox>
  69. </Grid>
  70. </Border>
  71. </Grid>
  72. </UserControl>