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.
47 lines
1.3 KiB
47 lines
1.3 KiB
using CommunityToolkit.Mvvm.Messaging;
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
using QYMessageCenter.Client.Models;
|
|
using SJ.Controls;
|
|
using System.Windows;
|
|
|
|
namespace QYMessageCenter.Client
|
|
{
|
|
/// <summary>
|
|
/// PopupWindow.xaml 的交互逻辑
|
|
/// </summary>
|
|
public partial class PopupWindow : BWindow
|
|
{
|
|
private Message msg;
|
|
public Message Msg { get => msg; set { Set(ref msg, value); } }
|
|
|
|
public PopupWindow(Message msg)
|
|
{
|
|
InitializeComponent();
|
|
this.Msg = msg;
|
|
this.DataContext = this;
|
|
this.Loaded += PopupWindow_Loaded;
|
|
}
|
|
|
|
private void PopupWindow_Loaded(object sender, RoutedEventArgs e)
|
|
{
|
|
//弹窗显示在右下角
|
|
this.Left = SystemParameters.WorkArea.Width - this.Width;
|
|
this.Top = SystemParameters.WorkArea.Height - this.Height;
|
|
}
|
|
|
|
public void RefreshMsg(Message msg)
|
|
{
|
|
this.Msg = msg;
|
|
}
|
|
|
|
private void btn_showNext_Click(object sender, RoutedEventArgs e)
|
|
{
|
|
WeakReferenceMessenger.Default.Send(new MVVMMessage_ShowNext(null));
|
|
}
|
|
|
|
private void btn_Close_Click(object sender, RoutedEventArgs e)
|
|
{
|
|
WeakReferenceMessenger.Default.Send(new MVVMMessage_ShowNext(null));
|
|
}
|
|
}
|
|
}
|
|
|