using GalaSoft.MvvmLight.Messaging; using Muchinfo.MTPClient.Data.Enums; using Muchinfo.MTPClient.Data.Model; 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; namespace Muchinfo.MTPClient.Account.Views { /// /// RiskControlView.xaml 的交互逻辑 /// public partial class RiskControlView : TradeAccountWindow { public RiskControlView() { InitializeComponent(); this.Loaded += RiskControlView_Loaded; this.Closing += RiskControlView_Closing; } void RiskControlView_Closing(object sender, System.ComponentModel.CancelEventArgs e) { e.Cancel = true; this.Visibility = Visibility.Hidden; } void RiskControlView_Loaded(object sender, RoutedEventArgs e) { SetWindow(); } private 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(); // MessengerHelper.DefaultSend(this.DataContext as RiskControl, MessengerTokens.AccountFunction); } } }