193 lines
9.6 KiB
XML
193 lines
9.6 KiB
XML
<Window xmlns="https://github.com/avaloniaui"
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
xmlns:vm="using:StreamPlayer.Desktop.ViewModels"
|
|
xmlns:models="using:StreamPlayer.Desktop.Models"
|
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
|
mc:Ignorable="d"
|
|
x:Class="StreamPlayer.Desktop.Views.MainWindow"
|
|
x:DataType="vm:MainWindowViewModel"
|
|
Icon="/Assets/avalonia-logo.ico"
|
|
Width="1200"
|
|
Height="720"
|
|
Title="StreamPlayer Desktop">
|
|
|
|
<Design.DataContext>
|
|
<vm:MainWindowViewModel/>
|
|
</Design.DataContext>
|
|
|
|
<Grid ColumnDefinitions="220,*" RowDefinitions="Auto,Auto,*"
|
|
IsEnabled="{Binding IsInteractionLocked, Converter={StaticResource InverseBooleanConverter}}">
|
|
<Border Grid.RowSpan="3"
|
|
Background="#111217"
|
|
Padding="0">
|
|
<ListBox ItemsSource="{Binding Sections}"
|
|
SelectedItem="{Binding SelectedSection}"
|
|
BorderThickness="0"
|
|
Background="Transparent"
|
|
Foreground="White">
|
|
<ListBox.Styles>
|
|
<Style Selector="ListBoxItem">
|
|
<Setter Property="Margin" Value="4"/>
|
|
<Setter Property="Padding" Value="14"/>
|
|
<Setter Property="CornerRadius" Value="6"/>
|
|
</Style>
|
|
<Style Selector="ListBoxItem:pointerover /template/ ContentPresenter">
|
|
<Setter Property="Background" Value="#2A2F3A"/>
|
|
</Style>
|
|
<Style Selector="ListBoxItem:selected /template/ ContentPresenter">
|
|
<Setter Property="Background" Value="#3A7AFE"/>
|
|
<Setter Property="Foreground" Value="White"/>
|
|
</Style>
|
|
</ListBox.Styles>
|
|
<ListBox.ItemTemplate>
|
|
<DataTemplate x:DataType="models:ChannelSection">
|
|
<TextBlock Text="{Binding Title}"
|
|
FontSize="15"
|
|
TextWrapping="Wrap"/>
|
|
</DataTemplate>
|
|
</ListBox.ItemTemplate>
|
|
</ListBox>
|
|
</Border>
|
|
|
|
<StackPanel Grid.Column="1"
|
|
Orientation="Horizontal"
|
|
VerticalAlignment="Center"
|
|
Margin="20,16,20,8"
|
|
Spacing="12">
|
|
<TextBlock Text="{Binding SelectedSection.Title, FallbackValue=StreamPlayer}"
|
|
FontSize="26"
|
|
FontWeight="SemiBold"/>
|
|
<Button Content="{Binding RefreshButtonLabel}"
|
|
Command="{Binding RefreshEventsCommand}"
|
|
IsVisible="{Binding IsShowingEvents}"
|
|
IsEnabled="{Binding IsRefreshingEvents, Converter={StaticResource InverseBooleanConverter}}"
|
|
HorizontalAlignment="Left"
|
|
VerticalAlignment="Center"
|
|
Padding="12,4"/>
|
|
</StackPanel>
|
|
|
|
<TextBlock Grid.Column="1"
|
|
Grid.Row="1"
|
|
Text="{Binding StatusMessage}"
|
|
Margin="20,0,20,8"
|
|
Foreground="#8A8F9C"
|
|
FontStyle="Italic"/>
|
|
|
|
<Grid Grid.Column="1" Grid.Row="2">
|
|
<ScrollViewer IsVisible="{Binding IsShowingEvents, Converter={StaticResource InverseBooleanConverter}}"
|
|
Margin="10"
|
|
VerticalScrollBarVisibility="Auto">
|
|
<ItemsControl ItemsSource="{Binding VisibleChannels}">
|
|
<ItemsControl.ItemsPanel>
|
|
<ItemsPanelTemplate>
|
|
<WrapPanel IsItemsHost="True" />
|
|
</ItemsPanelTemplate>
|
|
</ItemsControl.ItemsPanel>
|
|
<ItemsControl.ItemTemplate>
|
|
<DataTemplate x:DataType="models:StreamChannel">
|
|
<Button Command="{Binding $parent[Window].DataContext.OpenChannelCommand}"
|
|
CommandParameter="{Binding .}"
|
|
Margin="6"
|
|
Padding="16"
|
|
Width="220"
|
|
HorizontalContentAlignment="Stretch">
|
|
<StackPanel>
|
|
<TextBlock Text="{Binding Name}" FontWeight="SemiBold" TextWrapping="Wrap"/>
|
|
<TextBlock Text="{Binding PageUrl}" FontSize="11" Foreground="#8A8F9C"
|
|
TextWrapping="Wrap"/>
|
|
</StackPanel>
|
|
</Button>
|
|
</DataTemplate>
|
|
</ItemsControl.ItemTemplate>
|
|
</ItemsControl>
|
|
</ScrollViewer>
|
|
|
|
<ScrollViewer IsVisible="{Binding IsShowingEvents}"
|
|
Margin="10"
|
|
VerticalScrollBarVisibility="Auto">
|
|
<ItemsControl ItemsSource="{Binding VisibleEvents}">
|
|
<ItemsControl.ItemTemplate>
|
|
<DataTemplate x:DataType="models:LiveEvent">
|
|
<Border Margin="0,0,0,8"
|
|
Padding="14"
|
|
Background="#181C24"
|
|
CornerRadius="8">
|
|
<Grid>
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="*"/>
|
|
<ColumnDefinition Width="Auto"/>
|
|
</Grid.ColumnDefinitions>
|
|
<StackPanel>
|
|
<TextBlock Text="{Binding Title}"
|
|
FontSize="16"
|
|
FontWeight="SemiBold"
|
|
TextWrapping="Wrap"/>
|
|
<TextBlock Text="{Binding Subtitle}"
|
|
Foreground="#8A8F9C"
|
|
Margin="0,4,0,0"/>
|
|
<TextBlock Text="{Binding ChannelName}"
|
|
Foreground="#6FA8FF"
|
|
FontSize="13"/>
|
|
</StackPanel>
|
|
<StackPanel Grid.Column="1"
|
|
HorizontalAlignment="Right"
|
|
VerticalAlignment="Center"
|
|
Spacing="6">
|
|
<Button Content="Ver canal"
|
|
Command="{Binding $parent[Window].DataContext.OpenEventCommand}"
|
|
CommandParameter="{Binding .}"
|
|
Padding="12,4"/>
|
|
<Border Background="{Binding IsLive, Converter={StaticResource LiveStatusBrushConverter}}"
|
|
CornerRadius="4"
|
|
Padding="6"
|
|
HorizontalAlignment="Right">
|
|
<TextBlock Text="{Binding Status}"
|
|
Foreground="White"
|
|
FontSize="12"/>
|
|
</Border>
|
|
</StackPanel>
|
|
</Grid>
|
|
</Border>
|
|
</DataTemplate>
|
|
</ItemsControl.ItemTemplate>
|
|
</ItemsControl>
|
|
</ScrollViewer>
|
|
|
|
<Border Background="#CC0E1016"
|
|
IsVisible="{Binding IsLoading}">
|
|
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center" Spacing="12">
|
|
<ProgressBar Width="220" IsIndeterminate="True"/>
|
|
<TextBlock Text="Cargando contenido..."
|
|
Foreground="White"
|
|
FontSize="16"/>
|
|
</StackPanel>
|
|
</Border>
|
|
</Grid>
|
|
|
|
<Border Grid.ColumnSpan="2"
|
|
Grid.RowSpan="3"
|
|
Background="#CC000000"
|
|
IsVisible="{Binding IsInteractionLocked}">
|
|
<StackPanel HorizontalAlignment="Center"
|
|
VerticalAlignment="Center"
|
|
Spacing="12">
|
|
<ProgressBar Width="260"
|
|
IsIndeterminate="True"
|
|
IsVisible="{Binding IsDeviceCheckInProgress}"/>
|
|
<TextBlock Text="{Binding DeviceStatusMessage}"
|
|
Foreground="White"
|
|
FontSize="18"
|
|
TextAlignment="Center"
|
|
TextWrapping="Wrap"
|
|
Margin="0,4"/>
|
|
<TextBlock Text="Espera a que verifiquemos tu dispositivo…"
|
|
FontSize="14"
|
|
Foreground="#DDDDDD"
|
|
TextAlignment="Center"
|
|
TextWrapping="Wrap"/>
|
|
</StackPanel>
|
|
</Border>
|
|
</Grid>
|
|
</Window>
|