BililiveRecorder/BililiveRecorder.WPF/Pages/RoomListPage.xaml

125 lines
8.0 KiB
Plaintext
Raw Normal View History

2020-11-27 18:51:02 +08:00
<ui:Page
x:Class="BililiveRecorder.WPF.Pages.RoomListPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:ui="http://schemas.modernwpf.com/2019"
2021-01-03 13:21:36 +08:00
xmlns:l="https://github.com/XAMLMarkupExtensions/WPFLocalizationExtension"
2021-01-03 18:37:47 +08:00
l:LocalizeDictionary.DesignCulture=""
l:ResxLocalizationProvider.DefaultAssembly="BililiveRecorder.WPF"
l:ResxLocalizationProvider.DefaultDictionary="Strings"
2020-11-27 18:51:02 +08:00
xmlns:local="clr-namespace:BililiveRecorder.WPF.Pages"
2021-01-01 14:46:27 +08:00
xmlns:c="clr-namespace:BililiveRecorder.WPF.Controls"
2021-08-09 22:37:10 +08:00
xmlns:m="clr-namespace:BililiveRecorder.WPF.Models"
2020-11-27 18:51:02 +08:00
xmlns:converters="clr-namespace:BililiveRecorder.WPF.Converters"
mc:Ignorable="d"
2021-01-08 18:54:50 +08:00
x:Name="TheRoomListPage"
2020-11-27 18:51:02 +08:00
d:DesignHeight="1000" d:DesignWidth="960"
DataContext="{Binding RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=local:RootPage},Path=DataContext.Recorder,Mode=OneWay}"
2021-01-04 14:01:11 +08:00
>
2020-11-27 18:51:02 +08:00
<ui:Page.Resources>
<DataTemplate x:Key="NormalRoomCardTemplate">
<ui:ThemeShadowChrome IsShadowEnabled="True" Depth="10">
2021-01-01 14:46:27 +08:00
<c:RoomCard DeleteRequested="RoomCard_DeleteRequested" ShowSettingsRequested="RoomCard_ShowSettingsRequested" />
2020-11-27 18:51:02 +08:00
</ui:ThemeShadowChrome>
</DataTemplate>
<DataTemplate x:Key="AddRoomCardTemplate">
<ui:ThemeShadowChrome IsShadowEnabled="True" Depth="10">
2021-01-01 14:46:27 +08:00
<c:AddRoomCard AddRoomRequested="AddRoomCard_AddRoomRequested"/>
2020-11-27 18:51:02 +08:00
</ui:ThemeShadowChrome>
</DataTemplate>
<converters:NullValueTemplateSelector
x:Key="SelectorTemplate"
Normal="{StaticResource NormalRoomCardTemplate}"
Null="{StaticResource AddRoomCardTemplate}"/>
2021-01-08 18:54:50 +08:00
<converters:BoolToValueConverter x:Key="BooleanToUniformGridLayoutConverter">
<converters:BoolToValueConverter.TrueValue>
2021-04-21 23:18:23 +08:00
<ui:UniformGridLayout MinItemWidth="230" MinItemHeight="125"
2021-01-08 18:54:50 +08:00
ItemsStretch="None" MinRowSpacing="7" MinColumnSpacing="5"/>
</converters:BoolToValueConverter.TrueValue>
<converters:BoolToValueConverter.FalseValue>
2021-04-21 23:18:23 +08:00
<ui:UniformGridLayout MinItemWidth="230" MinItemHeight="100"
2021-01-08 18:54:50 +08:00
ItemsStretch="None" MinRowSpacing="7" MinColumnSpacing="5"/>
</converters:BoolToValueConverter.FalseValue>
</converters:BoolToValueConverter>
2020-11-27 18:51:02 +08:00
</ui:Page.Resources>
2020-12-05 18:30:04 +08:00
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition x:Name="RoomListRowDefinition" Height="*"/>
<RowDefinition Height="3"/>
<RowDefinition x:Name="LogRowDefinition" Height="0"/>
</Grid.RowDefinitions>
2021-01-05 15:41:26 +08:00
<StackPanel>
<Menu>
<Separator/>
<MenuItem Header="{l:Loc RoomListPage_Menu_File}">
<MenuItem Header="{l:Loc RoomListPage_Menu_File_OpenWorkDirectory}" Click="MenuItem_OpenWorkDirectory_Click"/>
<MenuItem Header="{l:Loc RoomListPage_Menu_File_SaveConfig}" Click="MenuItem_SaveConfig_Click"/>
2021-08-11 21:58:47 +08:00
<Separator/>
<MenuItem Header="{l:Loc RoomListPage_Menu_File_ChangeWorkPath}" Click="MenuItem_ChangeWorkPath_Click"/>
<Separator/>
2021-08-09 22:58:30 +08:00
<MenuItem Header="{l:Loc RoomListPage_Menu_File_ShowLogFilesInExplorer}" Click="MenuItem_ShowLogFilesInExplorer_Click"/>
2021-01-05 15:41:26 +08:00
</MenuItem>
2021-01-08 18:54:50 +08:00
<MenuItem Header="{l:Loc RoomListPage_Menu_View}">
2021-01-05 15:41:26 +08:00
<MenuItem Header="{l:Loc RoomListPage_Menu_Sort_Default}" Tag="{x:Static local:SortedBy.None}" Click="MenuItem_SortBy_Click"/>
<MenuItem Header="{l:Loc RoomListPage_Menu_Sort_RoomId}" Tag="{x:Static local:SortedBy.RoomId}" Click="MenuItem_SortBy_Click"/>
<MenuItem Header="{l:Loc RoomListPage_Menu_Sort_Status}" Tag="{x:Static local:SortedBy.Status}" Click="MenuItem_SortBy_Click"/>
2021-01-08 18:54:50 +08:00
<Separator/>
<MenuItem Header="开播时弹出系统通知" IsCheckable="True" IsChecked="{Binding Config.Global.WpfNotifyStreamStart}"/>
2021-01-08 18:54:50 +08:00
<MenuItem Header="{l:Loc RoomListPage_Menu_View_ShowTitleAndAreaCheckBox}" IsCheckable="True" IsChecked="{Binding Config.Global.WpfShowTitleAndArea}"/>
<MenuItem Header="{l:Loc RoomListPage_Menu_View_ShowLogCheckBox}" IsCheckable="True" Checked="MenuItem_ShowLog_Click" Unchecked="MenuItem_HideLog_Click"/>
2021-01-05 15:41:26 +08:00
</MenuItem>
2021-01-08 18:54:50 +08:00
<MenuItem Header="{l:Loc RoomListPage_Menu_AutoRecord}">
<MenuItem Header="{l:Loc RoomListPage_Menu_AutoRecord_EnableAll}" Click="MenuItem_EnableAutoRecAll_Click"/>
<MenuItem Header="{l:Loc RoomListPage_Menu_AutoRecord_DisableAll}" Click="MenuItem_DisableAutoRecAll_Click"/>
2022-06-04 02:34:09 +08:00
<Separator/>
<MenuItem Header="刷新全部房间信息" Click="MenuItem_RefreshAllRoomInfo_Click"/>
2021-01-05 15:41:26 +08:00
</MenuItem>
2021-07-15 19:57:41 +08:00
<MenuItem Header="{l:Loc RoomListPage_Menu_Links}">
<MenuItem Header="{l:Loc RoomListPage_Menu_Links_Website}" Command="{x:Static m:Commands.OpenLink}" CommandParameter="https://rec.danmuji.org/">
<MenuItem.Icon>
<ui:PathIcon Style="{StaticResource PathIconDataOpenInNew}"/>
</MenuItem.Icon>
</MenuItem>
<MenuItem Header="{l:Loc RoomListPage_Menu_Links_FAQ}" Command="{x:Static m:Commands.OpenLink}" CommandParameter="https://rec.danmuji.org/link/faq/">
<MenuItem.Icon>
<ui:PathIcon Style="{StaticResource PathIconDataOpenInNew}"/>
</MenuItem.Icon>
</MenuItem>
<MenuItem Header="{l:Loc RoomListPage_Menu_Links_Sponsor}" Command="{x:Static m:Commands.OpenLink}" CommandParameter="https://rec.danmuji.org/link/sponsor/">
<MenuItem.Icon>
<ui:PathIcon Style="{StaticResource PathIconDataOpenInNew}"/>
</MenuItem.Icon>
</MenuItem>
2021-06-26 21:21:35 +08:00
</MenuItem>
2021-11-21 00:08:31 +08:00
<MenuItem Header="{l:Loc RoomListPage_Menu_Links_Sponsor}" Command="{x:Static m:Commands.OpenLink}" CommandParameter="https://rec.danmuji.org/link/sponsor/">
<MenuItem.Icon>
<ui:PathIcon Style="{StaticResource PathIconDataOpenInNew}"/>
</MenuItem.Icon>
</MenuItem>
2021-01-05 15:41:26 +08:00
</Menu>
2021-01-03 13:21:36 +08:00
<Separator/>
2021-01-05 15:41:26 +08:00
</StackPanel>
2020-12-05 18:30:04 +08:00
<ui:ItemsRepeaterScrollHost Grid.Row="1">
<ScrollViewer>
<ui:ItemsRepeater
2020-11-27 18:51:02 +08:00
HorizontalAlignment="Stretch" Margin="8"
2021-01-08 18:54:50 +08:00
Layout="{Binding Config.Global.WpfShowTitleAndArea,Mode=OneWay,Converter={StaticResource BooleanToUniformGridLayoutConverter}}"
2021-01-15 17:41:33 +08:00
ItemsSource="{Binding RoomList, RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=ui:Page}}"
2020-11-27 18:51:02 +08:00
ItemTemplate="{StaticResource SelectorTemplate}" />
2020-12-05 18:30:04 +08:00
</ScrollViewer>
</ui:ItemsRepeaterScrollHost>
<GridSplitter Grid.Row="2" x:Name="Splitter" ResizeDirection="Rows" Visibility="Collapsed"
HorizontalAlignment="Stretch" VerticalAlignment="Stretch" ShowsPreview="True"/>
2021-02-23 18:03:37 +08:00
<ui:ThemeShadowChrome Grid.Row="3" x:Name="LogElement" IsShadowEnabled="True" Depth="10" Margin="5" Visibility="Collapsed">
2020-12-05 18:30:04 +08:00
<Border Background="{DynamicResource SystemControlBackgroundAltHighBrush}"
BorderBrush="{DynamicResource SystemControlBackgroundAccentBrush}"
BorderThickness="1" CornerRadius="5">
2021-02-23 18:03:37 +08:00
<c:LogPanel/>
2020-12-05 18:30:04 +08:00
</Border>
</ui:ThemeShadowChrome>
</Grid>
2020-11-27 18:51:02 +08:00
</ui:Page>