65 lines
1.5 KiB
C#
65 lines
1.5 KiB
C#
using _29WxOrderWpf.Commands;
|
|
using _29WxOrderWpf.Ctrls.PDDInvoice.ViewModels;
|
|
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.Navigation;
|
|
using System.Windows.Shapes;
|
|
using WPFCommon.Models;
|
|
using static Org.BouncyCastle.Math.EC.ECCurve;
|
|
|
|
namespace _29WxOrderWpf.Ctrls.PDDInvoice;
|
|
|
|
/// <summary>
|
|
/// PDDInvoiceDialog.xaml 的交互逻辑
|
|
/// </summary>
|
|
public partial class PDDInvoiceDialog : UserControl
|
|
{
|
|
public PDDInvoiceDialog()
|
|
{
|
|
InitializeComponent();
|
|
DataContext = this;
|
|
Config = NaiBa.Util.Helper.ConfigHelper.LoadConfig<InvoiceConfig>(ConfigPath);
|
|
}
|
|
|
|
private void PDDInvoiceDialog_Loaded(object sender, RoutedEventArgs e)
|
|
{
|
|
|
|
}
|
|
|
|
private void ViewModel_RequestClose()
|
|
{
|
|
Window parentWindow = Window.GetWindow(this);
|
|
if (this.IsLoaded && parentWindow != null)
|
|
parentWindow.Close();
|
|
}
|
|
|
|
|
|
private const string ConfigPath = "./invoice.config";
|
|
public InvoiceConfig Config { get; }
|
|
|
|
public ICommand ConfirmCommand => new DelegateCommand(Confirm);
|
|
|
|
private void Confirm()
|
|
{
|
|
NaiBa.Util.Helper.ConfigHelper.SaveConfig(ConfigPath, Config);
|
|
ViewModel_RequestClose();
|
|
}
|
|
public ICommand CancelCommand => new DelegateCommand(Cancel);
|
|
|
|
private void Cancel()
|
|
{
|
|
ViewModel_RequestClose();
|
|
}
|
|
}
|
|
|