文件命名格式设置添加恢复默认按钮

croire 3 years ago
parent 251619a4ba
commit 2ccdff96a8

@ -136,6 +136,7 @@
<system:String x:Key="DisplayVideoQuality">画质</system:String> <system:String x:Key="DisplayVideoQuality">画质</system:String>
<system:String x:Key="DisplayVideoCodec">视频编码</system:String> <system:String x:Key="DisplayVideoCodec">视频编码</system:String>
<system:String x:Key="DisplaySpace">空格</system:String> <system:String x:Key="DisplaySpace">空格</system:String>
<system:String x:Key="Reset">恢复默认</system:String>
<system:String x:Key="SettingDanmaku">弹幕</system:String> <system:String x:Key="SettingDanmaku">弹幕</system:String>
<system:String x:Key="FilterType">按类型屏蔽</system:String> <system:String x:Key="FilterType">按类型屏蔽</system:String>

@ -307,6 +307,27 @@ namespace DownKyi.ViewModels.Settings
SelectedOptionalField = -1; SelectedOptionalField = -1;
} }
// 重置选中文件名字段
private DelegateCommand resetCommand;
public DelegateCommand ResetCommand => resetCommand ?? (resetCommand = new DelegateCommand(ExecuteResetCommand));
/// <summary>
/// 重置选中文件名字段
/// </summary>
private void ExecuteResetCommand()
{
bool isSucceed = SettingsManager.GetInstance().SetFileNameParts(null);
PublishTip(isSucceed);
List<FileNamePart> fileNameParts = SettingsManager.GetInstance().GetFileNameParts();
SelectedFileName.Clear();
foreach (FileNamePart item in fileNameParts)
{
string display = DisplayFileNamePart(item);
SelectedFileName.Add(new DisplayFileNamePart { Id = item, Title = display });
}
}
#endregion #endregion

@ -144,6 +144,7 @@
<Grid.RowDefinitions> <Grid.RowDefinitions>
<RowDefinition /> <RowDefinition />
<RowDefinition /> <RowDefinition />
<RowDefinition />
</Grid.RowDefinitions> </Grid.RowDefinitions>
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
<ColumnDefinition Width="100" /> <ColumnDefinition Width="100" />
@ -194,6 +195,18 @@
</i:EventTrigger> </i:EventTrigger>
</i:Interaction.Triggers> </i:Interaction.Triggers>
</ListBox> </ListBox>
<Button
Grid.Row="2"
Grid.Column="1"
Width="75"
Margin="0,20,0,0"
HorizontalAlignment="Right"
VerticalAlignment="Center"
Command="{Binding ResetCommand}"
Content="{DynamicResource Reset}"
FontSize="12"
Style="{StaticResource BtnBorderStyle}" />
</Grid> </Grid>
</GroupBox> </GroupBox>

Loading…
Cancel
Save