Files
IPTVplayer/TV Player Avalonia/Views/ProgramsGroupView.axaml
T

48 lines
1.9 KiB
XML

<UserControl xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
x:Class="TV_Player.AvaloniaApp.Views.ProgramsGroupView">
<Grid VerticalAlignment="Center">
<ListBox ItemsSource="{Binding Programs}"
Background="Transparent"
BorderThickness="0"
ScrollViewer.HorizontalScrollBarVisibility="Disabled"
ScrollViewer.VerticalScrollBarVisibility="Auto">
<ListBox.ItemsPanel>
<ItemsPanelTemplate>
<UniformGrid Columns="4" />
</ItemsPanelTemplate>
</ListBox.ItemsPanel>
<ListBox.ItemTemplate>
<DataTemplate>
<Button Width="150"
Height="70"
Margin="8,6"
Classes="card"
Background="#B0000000"
BorderBrush="Yellow"
BorderThickness="2"
Command="{Binding DataContext.SelectGroupCommand, RelativeSource={RelativeSource AncestorType=UserControl}}"
CommandParameter="{Binding}">
<Grid RowDefinitions="*,Auto" VerticalAlignment="Center" HorizontalAlignment="Stretch">
<TextBlock Text="{Binding Name}"
Foreground="White"
FontSize="15"
TextWrapping="Wrap"
HorizontalAlignment="Center"
VerticalAlignment="Center"
TextAlignment="Center"
Margin="4,0" />
<TextBlock Text="{Binding Count}"
Grid.Row="1"
Foreground="White"
FontSize="10"
HorizontalAlignment="Center"
Margin="0,0,0,2" />
</Grid>
</Button>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
</Grid>
</UserControl>