240 lines
12 KiB
XML
240 lines
12 KiB
XML
<Window xmlns="https://github.com/avaloniaui"
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
xmlns:vm="using:BetterRaid.ViewModels"
|
|
xmlns:br="using:BetterRaid"
|
|
xmlns:con="using:BetterRaid.Converters"
|
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
|
xmlns:ai="using:AsyncImageLoader"
|
|
xmlns:misc="clr-namespace:BetterRaid.Misc"
|
|
mc:Ignorable="d"
|
|
d:DesignWidth="600"
|
|
d:DesignHeight="800"
|
|
Width="600"
|
|
Height="800"
|
|
x:Class="BetterRaid.Views.MainWindow"
|
|
x:DataType="vm:MainWindowViewModel"
|
|
Icon="/Assets/logo.png"
|
|
Title="BetterRaid"
|
|
Background="DarkSlateGray">
|
|
|
|
<Window.Resources>
|
|
<con:ChannelOnlineColorConverter x:Key="ChannelOnlineColorConverter" />
|
|
</Window.Resources>
|
|
|
|
<Grid HorizontalAlignment="Stretch"
|
|
VerticalAlignment="Stretch">
|
|
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="*" />
|
|
<ColumnDefinition Width="Auto" />
|
|
</Grid.ColumnDefinitions>
|
|
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="Auto" />
|
|
<RowDefinition Height="*" />
|
|
</Grid.RowDefinitions>
|
|
|
|
<Menu Grid.Column="0"
|
|
Grid.ColumnSpan="2"
|
|
Grid.Row="0">
|
|
|
|
<MenuItem Header="File">
|
|
<MenuItem Header="About"
|
|
CommandParameter="{Binding $parent[Window]}"
|
|
Command="{Binding ShowAboutWindow}" />
|
|
<Separator />
|
|
<MenuItem Header="Exit"
|
|
Command="{Binding ExitApplication}" />
|
|
</MenuItem>
|
|
</Menu>
|
|
|
|
<StackPanel Grid.Column="1"
|
|
Grid.Row="0"
|
|
Orientation="Horizontal"
|
|
Spacing="5">
|
|
|
|
<Button Command="{Binding LoginWithTwitch}"
|
|
IsVisible="{Binding !IsLoggedIn, Mode=OneWay, UpdateSourceTrigger=PropertyChanged}">
|
|
|
|
<Button.Styles>
|
|
<Style Selector="Button">
|
|
<Setter Property="Background" Value="#6441a5" />
|
|
</Style>
|
|
<Style Selector="Button:pointerover /template/ ContentPresenter">
|
|
<Setter Property="Background" Value="#b9a3e3" />
|
|
</Style>
|
|
</Button.Styles>
|
|
|
|
<StackPanel Orientation="Horizontal">
|
|
<TextBlock Text="Login"
|
|
Foreground="#f1f1f1"
|
|
FontSize="14" />
|
|
<Image Source="avares://BetterRaid/Assets/glitch_flat_white.png"
|
|
Width="16"
|
|
Height="16"
|
|
Margin="5, 0, 0, 0" />
|
|
</StackPanel>
|
|
</Button>
|
|
|
|
<CheckBox Content="Only Online"
|
|
IsChecked="{Binding Database.OnlyOnline, Mode=TwoWay}" />
|
|
|
|
<TextBox Grid.Column="1"
|
|
Grid.Row="0"
|
|
Width="200"
|
|
Margin="2"
|
|
Watermark="Filter Channels"
|
|
Text="{Binding Filter, Mode=TwoWay}"
|
|
HorizontalAlignment="Right" />
|
|
|
|
</StackPanel>
|
|
|
|
<TextBlock Text="Please login first!"
|
|
Grid.Column="0"
|
|
Grid.ColumnSpan="2"
|
|
Grid.Row="1"
|
|
IsVisible="{Binding !IsLoggedIn, Mode=OneWay, UpdateSourceTrigger=PropertyChanged}"
|
|
HorizontalAlignment="Center"
|
|
VerticalAlignment="Center"
|
|
TextAlignment="Center"
|
|
FontSize="24"
|
|
Foreground="#f1f1f1" />
|
|
|
|
<ScrollViewer Grid.Column="0"
|
|
Grid.ColumnSpan="2"
|
|
Grid.Row="1"
|
|
IsVisible="{Binding IsLoggedIn, Mode=OneWay, UpdateSourceTrigger=PropertyChanged}"
|
|
HorizontalScrollBarVisibility="Disabled"
|
|
VerticalScrollBarVisibility="Auto">
|
|
|
|
<ScrollViewer.GestureRecognizers>
|
|
<ScrollGestureRecognizer CanHorizontallyScroll="False"
|
|
CanVerticallyScroll="True"
|
|
IsScrollInertiaEnabled="True" />
|
|
</ScrollViewer.GestureRecognizers>
|
|
|
|
<ListBox ItemsSource="{Binding Channels}">
|
|
<ListBox.ItemTemplate>
|
|
<DataTemplate>
|
|
<Grid ColumnDefinitions="100, *, 120"
|
|
RowDefinitions="100">
|
|
|
|
<ai:AdvancedImage Grid.Column="0"
|
|
Grid.Row="0"
|
|
Source="{Binding ThumbnailUrl, TargetNullValue={x:Static br:App.ChannelPlaceholderImageUrl}}" />
|
|
|
|
<Border Grid.Column="0"
|
|
Grid.Row="0"
|
|
HorizontalAlignment="Right"
|
|
VerticalAlignment="Bottom"
|
|
Height="25"
|
|
MinWidth="25"
|
|
CornerRadius="12.5"
|
|
Background="{Binding IsLive, Converter={StaticResource ChannelOnlineColorConverter}}"
|
|
Padding="0"
|
|
Margin="0, 0, 5, 5">
|
|
|
|
<TextBlock Text="{Binding ViewerCount, TargetNullValue='-', Mode=OneWay, UpdateSourceTrigger=PropertyChanged}"
|
|
FontSize="12"
|
|
TextAlignment="Center"
|
|
FontWeight="SemiBold"
|
|
Padding="0"
|
|
Margin="5"
|
|
Foreground="Black"/>
|
|
</Border>
|
|
|
|
<Grid Grid.Column="1"
|
|
Grid.Row="0"
|
|
Margin="10, 0, 0, 0"
|
|
ColumnDefinitions="100, *"
|
|
RowDefinitions="20, 20, 40, 20">
|
|
<TextBlock Grid.Column="0"
|
|
Grid.Row="0"
|
|
Grid.ColumnSpan="2"
|
|
FontWeight="Bold"
|
|
TextDecorations="Underline"
|
|
Text="{Binding Name, TargetNullValue='???'}" />
|
|
|
|
<TextBlock Grid.Column="0"
|
|
Grid.Row="1"
|
|
Text="Category:"
|
|
FontWeight="SemiBold" />
|
|
|
|
<TextBlock Grid.Column="0"
|
|
Grid.Row="2"
|
|
Text="Title:"
|
|
FontWeight="SemiBold" />
|
|
|
|
<TextBlock Grid.Column="0"
|
|
Grid.Row="3"
|
|
Text="Last Raided:"
|
|
FontWeight="SemiBold" />
|
|
|
|
<TextBlock Grid.Column="1"
|
|
Grid.Row="1"
|
|
Text="{Binding Category, TargetNullValue='-'}" />
|
|
|
|
<TextBlock Grid.Column="1"
|
|
Grid.Row="2"
|
|
TextWrapping="Wrap"
|
|
Text="{Binding Title, TargetNullValue='-'}" />
|
|
|
|
<TextBlock Grid.Column="1"
|
|
Grid.Row="3"
|
|
Text="{Binding LastRaided, TargetNullValue='Never Raided'}" />
|
|
</Grid>
|
|
|
|
<StackPanel Grid.Column="2"
|
|
Grid.Row="0"
|
|
HorizontalAlignment="Stretch"
|
|
VerticalAlignment="Stretch">
|
|
|
|
<Button Content="Start Raid"
|
|
Height="50"
|
|
Margin="0"
|
|
CornerRadius="0"
|
|
Background="ForestGreen"
|
|
HorizontalAlignment="Stretch"
|
|
VerticalAlignment="Stretch"
|
|
HorizontalContentAlignment="Center"
|
|
VerticalContentAlignment="Center"
|
|
IsEnabled="{Binding IsLive}"
|
|
IsVisible="{Binding !$parent[Window].((vm:MainWindowViewModel)DataContext).DataService.IsRaidStarted}"
|
|
Command="{Binding $parent[Window].((vm:MainWindowViewModel)DataContext).DataService.StartRaidCommand}"
|
|
CommandParameter="{Binding BroadcasterId}" />
|
|
|
|
<Button Content="Cancel Raid"
|
|
Height="50"
|
|
Margin="0"
|
|
CornerRadius="0"
|
|
Background="DarkRed"
|
|
HorizontalAlignment="Stretch"
|
|
VerticalAlignment="Stretch"
|
|
HorizontalContentAlignment="Center"
|
|
VerticalContentAlignment="Center"
|
|
IsVisible="{Binding $parent[Window].((vm:MainWindowViewModel)DataContext).DataService.IsRaidStarted}"
|
|
Command="{Binding $parent[Window].((vm:MainWindowViewModel)DataContext).DataService.StopRaidCommand}" />
|
|
|
|
<Button Content="View Channel"
|
|
Height="50"
|
|
CornerRadius="0"
|
|
Margin="0"
|
|
HorizontalAlignment="Stretch"
|
|
VerticalAlignment="Stretch"
|
|
HorizontalContentAlignment="Center"
|
|
VerticalContentAlignment="Center"
|
|
Command="{Binding $parent[Window].((vm:MainWindowViewModel)DataContext).DataService.OpenChannelCommand}"
|
|
CommandParameter="{Binding Name}" />
|
|
</StackPanel>
|
|
</Grid>
|
|
</DataTemplate>
|
|
</ListBox.ItemTemplate>
|
|
</ListBox>
|
|
|
|
</ScrollViewer>
|
|
|
|
</Grid>
|
|
|
|
</Window>
|