51 lines
1.3 KiB
C#
51 lines
1.3 KiB
C#
using _29WxOrderWpf.Ctrls.Statistics.Models;
|
|
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;
|
|
|
|
namespace _29WxOrderWpf.Ctrls.Statistics;
|
|
|
|
/// <summary>
|
|
/// ShowOrderDialogView.xaml 的交互逻辑
|
|
/// </summary>
|
|
public partial class ShowOrderDialogView : UserControl
|
|
{
|
|
public ShowOrderDialogView(List<ShopRevenueStatisticsRow> list)
|
|
{
|
|
InitializeComponent();
|
|
this.DataContext = new ShowOrderDialogViewModel(list);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 复制订单号到剪贴板
|
|
/// </summary>
|
|
private void CopyOrderId_Click(object sender, RoutedEventArgs e)
|
|
{
|
|
if (sender is FrameworkElement element
|
|
&& element.DataContext is ShopRevenueStatisticsRow row
|
|
&& !string.IsNullOrEmpty(row.OrderId))
|
|
{
|
|
Clipboard.SetText(row.OrderId);
|
|
}
|
|
}
|
|
}
|
|
class ShowOrderDialogViewModel
|
|
{
|
|
public List<ShopRevenueStatisticsRow> Data { get; set; }
|
|
public ShowOrderDialogViewModel(List<ShopRevenueStatisticsRow> list)
|
|
{
|
|
Data = list ?? new List<ShopRevenueStatisticsRow>();
|
|
}
|
|
}
|