|
|
@ -1,4 +1,11 @@ |
|
|
|
using SJ.Controls; |
|
|
|
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; |
|
|
@ -20,18 +27,47 @@ namespace BBWYB.Client.Views.PackPurchaseTaska |
|
|
|
/// </summary>
|
|
|
|
public partial class UpdatePurchaseTaskWindow : BWindow |
|
|
|
{ |
|
|
|
public UpdatePurchaseTaskWindow() |
|
|
|
public UpdatePurchaseTaskWindow(PackTaskResponse packTaskResponse, string shopname, OrderSku order, Action ReflashWindow=null) |
|
|
|
{ |
|
|
|
InitializeComponent(); |
|
|
|
this.Loaded += UpdatePurchaseTaskWindow_Loaded; |
|
|
|
|
|
|
|
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<Message_BindingUpdatePurchaseTaskClose>(this); |
|
|
|
} |
|
|
|
|
|
|
|
private void UpdatePurchaseTaskWindow_Loaded(object sender, RoutedEventArgs e) |
|
|
|
{ |
|
|
|
|
|
|
|
WeakReferenceMessenger.Default.Register<Message_BindingUpdatePurchaseTaskClose>(this, (o, r) => |
|
|
|
{ |
|
|
|
this.DialogResult = r.Value; |
|
|
|
this.Close(); |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public class Message_BindingUpdatePurchaseTaskClose : ValueChangedMessage<bool> |
|
|
|
{ |
|
|
|
public Message_BindingUpdatePurchaseTaskClose(bool value) : base(value) |
|
|
|
{ |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|