Files
SpineViewer/SpineViewer/Views/ExporterDialogs/FrameSequenceExporterDialog.xaml.cs
2025-10-03 09:19:02 +08:00

64 lines
1.7 KiB
C#

using SpineViewer.Services;
using SpineViewer.ViewModels.Exporters;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
namespace SpineViewer.Views.ExporterDialogs
{
/// <summary>
/// FrameSequenceExporterDialog.xaml 的交互逻辑
/// </summary>
public partial class FrameSequenceExporterDialog : Window
{
public FrameSequenceExporterDialog()
{
InitializeComponent();
}
private void ButtonOK_Click(object sender, RoutedEventArgs e)
{
var vm = (FrameSequenceExporterViewModel)DataContext;
if (vm.Validate() is string err)
{
MessagePopupService.Error(err);
return;
}
DialogResult = true;
}
private void ButtonCancel_Click(object sender, RoutedEventArgs e)
{
DialogResult = false;
}
private void ButtonPickColor_Click(object sender, RoutedEventArgs e)
{
_colorPopup.IsOpen = !_colorPopup.IsOpen;
}
private void ColorPicker_Confirmed(object sender, HandyControl.Data.FunctionEventArgs<Color> e)
{
_colorPopup.IsOpen = false;
var color = e.Info;
var vm = (BaseExporterViewModel)DataContext;
vm.BackgroundColor = color;
}
private void ColorPicker_Canceled(object sender, EventArgs e)
{
_colorPopup.IsOpen = false;
}
}
}