RiskControlView.xaml.cs 1.9 KB

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