using BBWYB.Client.Models; using BBWYB.Client.Models.APIModel.Response.PackPurchaseTask; using BBWYB.Client.ViewModels; using BBWYB.Client.Views.Ware; using BBWYB.Client.Views.WebB; using CommunityToolkit.Mvvm.Messaging; using CommunityToolkit.Mvvm.Messaging.Messages; using SJ.Controls; 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 BBWYB.Client.Views.PackPurchaseTaska { /// /// UpdatePurchaseTaskWindow.xaml 的交互逻辑 /// public partial class UpdatePurchaseTaskWindow : BWindow { public UpdatePurchaseTaskWindow(PackTaskResponse packTaskResponse, string shopname, OrderSku order, Action ReflashWindow=null) { InitializeComponent(); var updatePackTask = (this.DataContext as UpdatePurchaseTaskViewModel); var show = updatePackTask.SearchSku(packTaskResponse, shopname, order); if (!show) this.Close(); if (ReflashWindow != null) updatePackTask.ReflashWindow= ReflashWindow; //this.Loaded += UpdatePurchaseTaskWindow_Loaded; //this.Unloaded += UpdatePurchaseTaskWindow_Unloaded; } private void UpdatePurchaseTaskWindow_Unloaded(object sender, RoutedEventArgs e) { WeakReferenceMessenger.Default.Unregister(this); } private void UpdatePurchaseTaskWindow_Loaded(object sender, RoutedEventArgs e) { WeakReferenceMessenger.Default.Register(this, (o, r) => { this.DialogResult = r.Value; this.Close(); }); } } public class Message_BindingUpdatePurchaseTaskClose : ValueChangedMessage { public Message_BindingUpdatePurchaseTaskClose(bool value) : base(value) { } } }