RiskView.xaml.cs 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. using GalaSoft.MvvmLight.Messaging;
  2. using Muchinfo.MTPClient.Data.Enums;
  3. using Muchinfo.MTPClient.Infrastructure.Windows;
  4. using System;
  5. using System.Collections.Generic;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Windows;
  9. using System.Windows.Controls;
  10. using System.Windows.Data;
  11. using System.Windows.Documents;
  12. using System.Windows.Input;
  13. using System.Windows.Media;
  14. using System.Windows.Media.Imaging;
  15. using System.Windows.Shapes;
  16. using Muchinfo.MTPClient.Infrastructure.Helpers;
  17. namespace Muchinfo.MTPClient.Account.Views
  18. {
  19. /// <summary>
  20. /// RiskView.xaml 的交互逻辑
  21. /// </summary>
  22. public partial class RiskView : TradeAccountWindow
  23. {
  24. public RiskView()
  25. {
  26. InitializeComponent();
  27. this.Loaded+=RiskView_Loaded;
  28. this.Closing+=RiskView_Closing;
  29. }
  30. void RiskView_Closing(object sender, System.ComponentModel.CancelEventArgs e)
  31. {
  32. e.Cancel = true;
  33. this.Visibility = Visibility.Hidden;
  34. }
  35. void RiskView_Loaded(object sender, RoutedEventArgs e)
  36. {
  37. SetWindow();
  38. }
  39. private void Grid_MouseDown(object sender, MouseButtonEventArgs e)
  40. {
  41. this.Close();
  42. MessengerHelper.DefaultSend(TradeTreeMenu.Ntf, MessengerTokens.AccountFunction);
  43. }
  44. public void SetWindow()
  45. {
  46. double m_ScreenWidth = SystemParameters.WorkArea.Width;
  47. double m_ScreenHeight = SystemParameters.WorkArea.Height;
  48. this.Left = m_ScreenWidth - this.Width - 1.5;
  49. this.Top = m_ScreenHeight - this.Height - 1.5;
  50. }
  51. public void Shows()
  52. {
  53. if (this.Visibility == Visibility.Hidden)
  54. {
  55. SetWindow();
  56. this.Visibility = Visibility.Visible;
  57. }
  58. }
  59. }
  60. }