123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126 |
- <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"
- xmlns:vm="clr-namespace:ApplicationAvalonia.ViewModels"
- x:DataType="vm:HomeViewModel"
- x:Class="ApplicationAvalonia.Views.HomeView"
- x:Name="root"
- xmlns:asyncImageLoader="clr-namespace:AsyncImageLoader;assembly=AsyncImageLoader.Avalonia"
- >
- <Grid RowDefinitions="80, *">
- <DockPanel LastChildFill="False" VerticalAlignment="Center" >
- <Image Source="/Assets/knpsb2_157dafdc.jpg" Height="100"/>
- <Button Content="Личный кабинет" FontSize="12" Command="{Binding GoToPersonalCabinetCommand}"
- DockPanel.Dock="Right" Margin="0 0 20 0"/>
- </DockPanel>
- <Border Grid.Row="1">
- <Grid ColumnDefinitions="300, *">
- <Border Grid.Column="0" CornerRadius="30" Background="#141414"
- Padding="30">
- <Grid RowDefinitions="80, *">
- <TextBox Width="200" Grid.Row="0" HorizontalAlignment="Center" VerticalAlignment="Center"
- Watermark="Найти фильм" Text="{Binding TextSearch}"/>
- <ListBox ItemsSource="{Binding Genres}" Grid.Row="1" Background="#141414" >
- <ListBox.ItemsPanel>
- <ItemsPanelTemplate>
- <WrapPanel HorizontalAlignment="Center" VerticalAlignment="Center"
- ItemHeight="60" Orientation="Horizontal"/>
- </ItemsPanelTemplate>
- </ListBox.ItemsPanel>
- <ListBox.ItemTemplate>
- <DataTemplate>
- <ToggleButton Content="{Binding GenreName}" Padding="10 5"
- Checked="ToggleButton_Checked_1" Unchecked="ToggleButton_Unchecked_2"
- Command="{Binding #root.((vm:HomeViewModel)DataContext).CallCategoryCommand}"
- CommandParameter="{Binding Id}" />
- </DataTemplate>
- </ListBox.ItemTemplate>
- </ListBox>
- </Grid>
- </Border>
- <ListBox Grid.Column="1" ItemsSource="{Binding ListFilms}" Background="#211F1F" >
- <ListBox.ItemsPanel>
- <ItemsPanelTemplate>
- <WrapPanel HorizontalAlignment="Center" VerticalAlignment="Center" />
- </ItemsPanelTemplate>
- </ListBox.ItemsPanel>
- <ListBox.ItemTemplate >
- <DataTemplate>
- <Border CornerRadius="10" MaxWidth="450" MinWidth="300"
- MinHeight="400" MaxHeight="400" Background="#4B4B4B"
- Padding="20">
- <StackPanel Orientation="Vertical">
- <Image asyncImageLoader:ImageLoader.Source="{Binding Image}"
- MaxHeight="200" MaxWidth="250" />
- <TextBlock Text="{Binding Name}"
- Margin="0 10" HorizontalAlignment="Center" />
- <TextBlock Text="{Binding Duration, StringFormat=Продолжительность: {0}}" Margin="0 10" />
- <TextBlock Text="{Binding Raiting, StringFormat=Рейтинг: {0}}" Margin="0 10" />
- <Button Command="{Binding #root.((vm:HomeViewModel)DataContext).FilmInfoCommand}"
- CommandParameter="{Binding Id}" HorizontalAlignment="Center"
- Content="Подробнее" Foreground="White" Background="Black"/>
- </StackPanel>
- </Border>
- </DataTemplate>
- </ListBox.ItemTemplate>
- </ListBox>
- </Grid>
- </Border>
- </Grid>
- </UserControl>
|