重构
This commit is contained in:
@@ -7,6 +7,7 @@ using Spine.Exporters;
|
||||
using SpineViewer.Extensions;
|
||||
using SpineViewer.Models;
|
||||
using SpineViewer.Resources;
|
||||
using SpineViewer.Services;
|
||||
using SpineViewer.ViewModels.MainWindow;
|
||||
using System;
|
||||
using System.Collections;
|
||||
@@ -74,6 +75,16 @@ namespace SpineViewer.ViewModels.Exporters
|
||||
public uint MaxResolution { get => _maxResolution; set => SetProperty(ref _maxResolution, value); }
|
||||
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>
|
||||
|
||||
@@ -92,7 +92,7 @@
|
||||
</Grid.ColumnDefinitions>
|
||||
<Label Content="{DynamicResource Str_OutputDir}" ToolTip="{DynamicResource Str_OutputDirTooltip}"/>
|
||||
<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}"/>
|
||||
</DockPanel>
|
||||
</Grid>
|
||||
|
||||
@@ -42,15 +42,6 @@ namespace SpineViewer.Views.ExporterDialogs
|
||||
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)
|
||||
{
|
||||
|
||||
|
||||
@@ -92,7 +92,7 @@
|
||||
</Grid.ColumnDefinitions>
|
||||
<Label Content="{DynamicResource Str_OutputDir}" ToolTip="{DynamicResource Str_OutputDirTooltip}"/>
|
||||
<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}"/>
|
||||
</DockPanel>
|
||||
</Grid>
|
||||
|
||||
@@ -42,15 +42,6 @@ namespace SpineViewer.Views.ExporterDialogs
|
||||
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)
|
||||
{
|
||||
|
||||
|
||||
@@ -92,7 +92,7 @@
|
||||
</Grid.ColumnDefinitions>
|
||||
<Label Content="{DynamicResource Str_OutputDir}" ToolTip="{DynamicResource Str_OutputDirTooltip}"/>
|
||||
<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}"/>
|
||||
</DockPanel>
|
||||
</Grid>
|
||||
|
||||
@@ -42,15 +42,6 @@ namespace SpineViewer.Views.ExporterDialogs
|
||||
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)
|
||||
{
|
||||
|
||||
|
||||
@@ -92,7 +92,7 @@
|
||||
</Grid.ColumnDefinitions>
|
||||
<Label Content="{DynamicResource Str_OutputDir}" ToolTip="{DynamicResource Str_OutputDirTooltip}"/>
|
||||
<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}"/>
|
||||
</DockPanel>
|
||||
</Grid>
|
||||
|
||||
@@ -42,15 +42,6 @@ namespace SpineViewer.Views.ExporterDialogs
|
||||
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)
|
||||
{
|
||||
|
||||
|
||||
Reference in New Issue
Block a user