|
|
|
using BBWYB.Client.Models;
|
|
|
|
using BBWYB.Client.Models.APIModel.Response.PackPurchaseTask;
|
|
|
|
using BBWYB.Client.ViewModels;
|
|
|
|
using CommunityToolkit.Mvvm.Messaging;
|
|
|
|
using CommunityToolkit.Mvvm.Messaging.Messages;
|
|
|
|
using SJ.Controls;
|
|
|
|
using System;
|
|
|
|
using System.Windows;
|
|
|
|
|
|
|
|
namespace BBWYB.Client.Views.PackPurchaseTaska
|
|
|
|
{
|
|
|
|
/// <summary>
|
|
|
|
/// UpdatePurchaseTaskWindow.xaml 的交互逻辑
|
|
|
|
/// </summary>
|
|
|
|
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(); IsClosed = true; }
|
|
|
|
|
|
|
|
if (ReflashWindow != null)
|
|
|
|
updatePackTask.ReflashWindow = ReflashWindow;
|
|
|
|
|
|
|
|
|
|
|
|
//this.Loaded += UpdatePurchaseTaskWindow_Loaded;
|
|
|
|
//this.Unloaded += UpdatePurchaseTaskWindow_Unloaded;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public bool IsClosed { get; set; }=false;
|
|
|
|
|
|
|
|
|
|
|
|
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)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|