using GalaSoft.MvvmLight.Messaging; using Muchinfo.MTPClient.Data.Enums; using Muchinfo.MTPClient.Data.Model.Message; using Muchinfo.MTPClient.Infrastructure.Windows; using System; using System.Collections.Generic; using System.Linq; using System.Text; 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; using Muchinfo.MTPClient.Infrastructure.Helpers; using Muchinfo.MTPClient.Resources; namespace Muchinfo.MTPClient.Account.Views { /// /// NoticeView.xaml 的交互逻辑 /// public partial class NoticeView : TradeAccountWindow { public NoticeView( ) { InitializeComponent(); this.Loaded+=NoticeView_Loaded; this.Closing+=NoticeView_Closing; } void NoticeView_Closing(object sender, System.ComponentModel.CancelEventArgs e) { e.Cancel = true; this.Visibility = Visibility.Hidden; } void NoticeView_Loaded(object sender, RoutedEventArgs e) { SetWindow(); } public void SetWindow() { double m_ScreenWidth = SystemParameters.WorkArea.Width; double m_ScreenHeight = SystemParameters.WorkArea.Height; this.Left = m_ScreenWidth - this.Width - 1.5; this.Top = m_ScreenHeight - this.Height - 1.5; } public void Shows() { if (this.Visibility == Visibility.Hidden) { SetWindow(); this.Visibility = Visibility.Visible; } } private void Grid_MouseDown(object sender, MouseButtonEventArgs e) { this.Close(); var notice = this.DataContext as NoticeMsg; if (notice != null && !notice.IsClicked) { MessengerHelper.DefaultSend(notice, MessengerTokens.AnnouncementDetail); } } } }