using _29WxOrderWpf.BaseWindows; 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; /// /// ShowOrderDialogView.xaml 的交互逻辑 /// public partial class ShowOrderDialogView : UserControl { public ShowOrderDialogView(List list) { InitializeComponent(); this.DataContext = new ShowOrderDialogViewModel(list); } /// /// 复制订单号到剪贴板 /// private void CopyOrderId_Click(object sender, RoutedEventArgs e) { if (sender is FrameworkElement element && element.DataContext is ShopRevenueStatisticsRow row && !string.IsNullOrEmpty(row.OrderId)) { Window window = Window.GetWindow(this); try { Clipboard.SetDataObject(row.OrderId); BaseMsgWindow.ShowAnimateMessage("复制成功"); } catch (Exception ex) { BaseMsgWindow.ShowError("复制失败 " + ex.Message,window: window); } } } } class ShowOrderDialogViewModel { public List Data { get; set; } public ShowOrderDialogViewModel(List list) { Data = list ?? new List(); } }