BililiveRecorder/BililiveRecorder.WPF/Controls/PerRoomSettingsDialog.xaml
2021-04-20 22:28:52 +08:00

95 lines
6.9 KiB
XML

<ui:ContentDialog
x:Class="BililiveRecorder.WPF.Controls.PerRoomSettingsDialog"
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"
xmlns:l="https://github.com/XAMLMarkupExtensions/WPFLocalizationExtension"
l:LocalizeDictionary.DesignCulture=""
l:ResxLocalizationProvider.DefaultAssembly="BililiveRecorder.WPF"
l:ResxLocalizationProvider.DefaultDictionary="Strings"
xmlns:local="clr-namespace:BililiveRecorder.WPF.Controls"
xmlns:confiv2="clr-namespace:BililiveRecorder.Core.Config.V2;assembly=BililiveRecorder.Core"
xmlns:core="clr-namespace:BililiveRecorder.Core;assembly=BililiveRecorder.Core"
d:DataContext="{d:DesignInstance core:Room}"
DefaultButton="Close"
CloseButtonText="{l:Loc Global_Close}"
mc:Ignorable="d">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<StackPanel>
<ContentControl Content="{Binding}" ContentTemplate="{StaticResource RoomDialogHeader}"/>
<Separator/>
</StackPanel>
<ScrollViewer Grid.Row="1">
<ui:SimpleStackPanel Orientation="Vertical" Spacing="5" DataContext="{Binding RoomConfig}">
<GroupBox Header="{l:Loc Settings_Danmaku_Title}">
<StackPanel>
<local:SettingWithDefault IsSettingNotUsingDefault="{Binding HasRecordDanmaku}">
<ui:ToggleSwitch IsOn="{Binding RecordDanmaku}" OnContent="{l:Loc Settings_Danmaku_ToggleSwitch_Enabled}" OffContent="{l:Loc Settings_Danmaku_ToggleSwitch_Enabled}"/>
</local:SettingWithDefault>
<local:SettingWithDefault IsSettingNotUsingDefault="{Binding HasRecordDanmakuSuperChat}">
<ui:ToggleSwitch IsOn="{Binding RecordDanmakuSuperChat}" OnContent="{l:Loc Settings_Danmaku_ToggleSwitch_SuperChat}" OffContent="{l:Loc Settings_Danmaku_ToggleSwitch_SuperChat}"/>
</local:SettingWithDefault>
<local:SettingWithDefault IsSettingNotUsingDefault="{Binding HasRecordDanmakuGuard}">
<ui:ToggleSwitch IsOn="{Binding RecordDanmakuGuard}" OnContent="{l:Loc Settings_Danmaku_ToggleSwitch_Guard}" OffContent="{l:Loc Settings_Danmaku_ToggleSwitch_Guard}"/>
</local:SettingWithDefault>
<local:SettingWithDefault IsSettingNotUsingDefault="{Binding HasRecordDanmakuGift}">
<ui:ToggleSwitch IsOn="{Binding RecordDanmakuGift}" OnContent="{l:Loc Settings_Danmaku_ToggleSwitch_Gift}" OffContent="{l:Loc Settings_Danmaku_ToggleSwitch_Gift}"/>
</local:SettingWithDefault>
<local:SettingWithDefault IsSettingNotUsingDefault="{Binding HasRecordDanmakuRaw}">
<ui:ToggleSwitch IsOn="{Binding RecordDanmakuRaw}" OnContent="{l:Loc Settings_Danmaku_ToggleSwitch_Raw}" OffContent="{l:Loc Settings_Danmaku_ToggleSwitch_Raw}"/>
</local:SettingWithDefault>
</StackPanel>
</GroupBox>
<GroupBox Header="录制模式">
<StackPanel>
<local:SettingWithDefault IsSettingNotUsingDefault="{Binding HasRecordMode}">
<StackPanel>
<RadioButton GroupName="RecordMode" Content="标准模式"
IsChecked="{Binding Path=RecordMode, Converter={StaticResource EnumToBooleanConverter},
ConverterParameter={x:Static confiv2:RecordMode.Standard}}" />
<RadioButton GroupName="RecordMode" Content="原始数据模式"
IsChecked="{Binding Path=RecordMode, Converter={StaticResource EnumToBooleanConverter},
ConverterParameter={x:Static confiv2:RecordMode.RawData}}" />
</StackPanel>
</local:SettingWithDefault>
</StackPanel>
</GroupBox>
<GroupBox Header="{l:Loc Settings_Splitting_Title}">
<StackPanel>
<local:SettingWithDefault IsSettingNotUsingDefault="{Binding HasCuttingMode}">
<StackPanel>
<RadioButton GroupName="Splitting" Content="{l:Loc Settings_Splitting_RadioButton_Disabled}"
IsChecked="{Binding Path=CuttingMode, Converter={StaticResource EnumToBooleanConverter},
ConverterParameter={x:Static confiv2:CuttingMode.Disabled}}" />
<RadioButton GroupName="Splitting" Content="{l:Loc Settings_Splitting_RadioButton_BySize}"
IsChecked="{Binding Path=CuttingMode, Converter={StaticResource EnumToBooleanConverter},
ConverterParameter={x:Static confiv2:CuttingMode.BySize}}" />
<RadioButton GroupName="Splitting" Content="{l:Loc Settings_Splitting_RadioButton_ByTime}"
IsChecked="{Binding Path=CuttingMode, Converter={StaticResource EnumToBooleanConverter},
ConverterParameter={x:Static confiv2:CuttingMode.ByTime}}" />
</StackPanel>
</local:SettingWithDefault>
<local:SettingWithDefault IsSettingNotUsingDefault="{Binding HasCuttingNumber}">
<StackPanel Orientation="Horizontal" VerticalAlignment="Center" Margin="0,5,0,0">
<TextBlock VerticalAlignment="Center" Text="{l:Loc Settings_Splitting_TextBox_Left}"/>
<TextBox Margin="5,0" Width="100" Text="{Binding CuttingNumber}" ui:TextBoxHelper.IsDeleteButtonVisible="False"/>
<TextBlock VerticalAlignment="Center" Text="{l:Loc Settings_Splitting_TextBox_TimeUnit}"/>
<TextBlock VerticalAlignment="Center" Text="/"/>
<TextBlock VerticalAlignment="Center" Text="{l:Loc Settings_Splitting_TextBox_SizeUnit}"/>
<TextBlock VerticalAlignment="Center" Text=" "/>
<TextBlock VerticalAlignment="Center" Text="{l:Loc Settings_Splitting_TextBox_Right}"/>
</StackPanel>
</local:SettingWithDefault>
</StackPanel>
</GroupBox>
</ui:SimpleStackPanel>
</ScrollViewer>
</Grid>
</ui:ContentDialog>