This commit is contained in:
ww-rm
2025-10-02 22:42:21 +08:00
parent 2204eb6c75
commit b448ca8cb0
9 changed files with 15 additions and 40 deletions

View File

@@ -7,6 +7,7 @@ using Spine.Exporters;
using SpineViewer.Extensions; using SpineViewer.Extensions;
using SpineViewer.Models; using SpineViewer.Models;
using SpineViewer.Resources; using SpineViewer.Resources;
using SpineViewer.Services;
using SpineViewer.ViewModels.MainWindow; using SpineViewer.ViewModels.MainWindow;
using System; using System;
using System.Collections; using System.Collections;
@@ -74,6 +75,16 @@ namespace SpineViewer.ViewModels.Exporters
public uint MaxResolution { get => _maxResolution; set => SetProperty(ref _maxResolution, value); } public uint MaxResolution { get => _maxResolution; set => SetProperty(ref _maxResolution, value); }
protected uint _maxResolution = 2048; protected uint _maxResolution = 2048;
public RelayCommand Cmd_SelectOutputDir => _cmd_SelectOutputDir ??= new(() =>
{
if (DialogService.ShowOpenFolderDialog(out var selectedPath))
{
_outputDir = selectedPath;
OnPropertyChanged(nameof(OutputDir));
}
});
protected RelayCommand _cmd_SelectOutputDir;
/// <summary> /// <summary>
/// 使用提供的包围盒设置自动分辨率 /// 使用提供的包围盒设置自动分辨率
/// </summary> /// </summary>

View File

@@ -92,7 +92,7 @@
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<Label Content="{DynamicResource Str_OutputDir}" ToolTip="{DynamicResource Str_OutputDirTooltip}"/> <Label Content="{DynamicResource Str_OutputDir}" ToolTip="{DynamicResource Str_OutputDirTooltip}"/>
<DockPanel Grid.Column="1"> <DockPanel Grid.Column="1">
<Button DockPanel.Dock="Right" Content="..." Click="ButtonSelectOutputDir_Click"/> <Button DockPanel.Dock="Right" Content="..." Command="{Binding Cmd_SelectOutputDir}"/>
<TextBox Text="{Binding OutputDir}" ToolTip="{DynamicResource Str_OutputDirTooltip}"/> <TextBox Text="{Binding OutputDir}" ToolTip="{DynamicResource Str_OutputDirTooltip}"/>
</DockPanel> </DockPanel>
</Grid> </Grid>

View File

@@ -42,15 +42,6 @@ namespace SpineViewer.Views.ExporterDialogs
DialogResult = false; DialogResult = false;
} }
private void ButtonSelectOutputDir_Click(object sender, RoutedEventArgs e)
{
if (DialogService.ShowOpenFolderDialog(out var selectedPath))
{
var vm = (CustomFFmpegExporterViewModel)DataContext;
vm.OutputDir = selectedPath;
}
}
private void ButtonPickColor_Click(object sender, RoutedEventArgs e) private void ButtonPickColor_Click(object sender, RoutedEventArgs e)
{ {

View File

@@ -92,7 +92,7 @@
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<Label Content="{DynamicResource Str_OutputDir}" ToolTip="{DynamicResource Str_OutputDirTooltip}"/> <Label Content="{DynamicResource Str_OutputDir}" ToolTip="{DynamicResource Str_OutputDirTooltip}"/>
<DockPanel Grid.Column="1"> <DockPanel Grid.Column="1">
<Button DockPanel.Dock="Right" Content="..." Click="ButtonSelectOutputDir_Click"/> <Button DockPanel.Dock="Right" Content="..." Command="{Binding Cmd_SelectOutputDir}"/>
<TextBox Text="{Binding OutputDir}" ToolTip="{DynamicResource Str_OutputDirTooltip}"/> <TextBox Text="{Binding OutputDir}" ToolTip="{DynamicResource Str_OutputDirTooltip}"/>
</DockPanel> </DockPanel>
</Grid> </Grid>

View File

@@ -42,15 +42,6 @@ namespace SpineViewer.Views.ExporterDialogs
DialogResult = false; DialogResult = false;
} }
private void ButtonSelectOutputDir_Click(object sender, RoutedEventArgs e)
{
if (DialogService.ShowOpenFolderDialog(out var selectedPath))
{
var vm = (FFmpegVideoExporterViewModel)DataContext;
vm.OutputDir = selectedPath;
}
}
private void ButtonPickColor_Click(object sender, RoutedEventArgs e) private void ButtonPickColor_Click(object sender, RoutedEventArgs e)
{ {

View File

@@ -92,7 +92,7 @@
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<Label Content="{DynamicResource Str_OutputDir}" ToolTip="{DynamicResource Str_OutputDirTooltip}"/> <Label Content="{DynamicResource Str_OutputDir}" ToolTip="{DynamicResource Str_OutputDirTooltip}"/>
<DockPanel Grid.Column="1"> <DockPanel Grid.Column="1">
<Button DockPanel.Dock="Right" Content="..." Click="ButtonSelectOutputDir_Click"/> <Button DockPanel.Dock="Right" Content="..." Command="{Binding Cmd_SelectOutputDir}"/>
<TextBox Text="{Binding OutputDir}" ToolTip="{DynamicResource Str_OutputDirTooltip}"/> <TextBox Text="{Binding OutputDir}" ToolTip="{DynamicResource Str_OutputDirTooltip}"/>
</DockPanel> </DockPanel>
</Grid> </Grid>

View File

@@ -42,15 +42,6 @@ namespace SpineViewer.Views.ExporterDialogs
DialogResult = false; DialogResult = false;
} }
private void ButtonSelectOutputDir_Click(object sender, RoutedEventArgs e)
{
if (DialogService.ShowOpenFolderDialog(out var selectedPath))
{
var vm = (FrameExporterViewModel)DataContext;
vm.OutputDir = selectedPath;
}
}
private void ButtonPickColor_Click(object sender, RoutedEventArgs e) private void ButtonPickColor_Click(object sender, RoutedEventArgs e)
{ {

View File

@@ -92,7 +92,7 @@
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<Label Content="{DynamicResource Str_OutputDir}" ToolTip="{DynamicResource Str_OutputDirTooltip}"/> <Label Content="{DynamicResource Str_OutputDir}" ToolTip="{DynamicResource Str_OutputDirTooltip}"/>
<DockPanel Grid.Column="1"> <DockPanel Grid.Column="1">
<Button DockPanel.Dock="Right" Content="..." Click="ButtonSelectOutputDir_Click"/> <Button DockPanel.Dock="Right" Content="..." Command="{Binding Cmd_SelectOutputDir}"/>
<TextBox Text="{Binding OutputDir}" ToolTip="{DynamicResource Str_OutputDirTooltip}"/> <TextBox Text="{Binding OutputDir}" ToolTip="{DynamicResource Str_OutputDirTooltip}"/>
</DockPanel> </DockPanel>
</Grid> </Grid>

View File

@@ -42,15 +42,6 @@ namespace SpineViewer.Views.ExporterDialogs
DialogResult = false; DialogResult = false;
} }
private void ButtonSelectOutputDir_Click(object sender, RoutedEventArgs e)
{
if (DialogService.ShowOpenFolderDialog(out var selectedPath))
{
var vm = (FrameSequenceExporterViewModel)DataContext;
vm.OutputDir = selectedPath;
}
}
private void ButtonPickColor_Click(object sender, RoutedEventArgs e) private void ButtonPickColor_Click(object sender, RoutedEventArgs e)
{ {