You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
50 lines
1.5 KiB
50 lines
1.5 KiB
using CommunityToolkit.Mvvm.Messaging;
|
|
using CommunityToolkit.Mvvm.Messaging.Messages;
|
|
using SJ.Controls;
|
|
using System.Windows;
|
|
|
|
namespace BBWYB.Client.Views.Ware
|
|
{
|
|
/// <summary>
|
|
/// BindingPurchaseProduct.xaml 的交互逻辑
|
|
/// </summary>
|
|
public partial class BindingPurchaseProduct : BWindow
|
|
{
|
|
public BindingPurchaseProduct()
|
|
{
|
|
InitializeComponent();
|
|
//Messenger.Default.Register<bool>(this, "BindingPurchaseProduct_Close", (x) =>
|
|
// {
|
|
// this.Dispatcher.Invoke(() =>
|
|
// {
|
|
// this.DialogResult = x;
|
|
// this.Close();
|
|
// });
|
|
// });
|
|
|
|
WeakReferenceMessenger.Default.Register<Message_BindingPurchaseProductClose>(this, (o, x) =>
|
|
{
|
|
this.Dispatcher.Invoke(() =>
|
|
{
|
|
this.DialogResult = x.Value;
|
|
this.Close();
|
|
});
|
|
});
|
|
|
|
this.Unloaded += BindingPurchaseProduct_Unloaded;
|
|
}
|
|
|
|
private void BindingPurchaseProduct_Unloaded(object sender, RoutedEventArgs e)
|
|
{
|
|
//Messenger.Default.Unregister(this);
|
|
WeakReferenceMessenger.Default.UnregisterAll(this);
|
|
}
|
|
}
|
|
|
|
public class Message_BindingPurchaseProductClose : ValueChangedMessage<bool>
|
|
{
|
|
public Message_BindingPurchaseProductClose(bool value) : base(value)
|
|
{
|
|
}
|
|
}
|
|
}
|
|
|