RiskControlNoticeView.xaml.cs 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. using Muchinfo.MTPClient.Account.ViewModels;
  2. using Muchinfo.MTPClient.Data.Model;
  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.Navigation;
  16. using System.Windows.Shapes;
  17. namespace Muchinfo.MTPClient.Account.Views
  18. {
  19. /// <summary>
  20. /// AirControlNotice.xaml 的交互逻辑
  21. /// </summary>
  22. public partial class RiskControlNoticeView : TradeAccountWindow
  23. {
  24. public RiskControlNoticeView(System.Collections.ObjectModel.ObservableCollection<Announcement> riskList)
  25. {
  26. InitializeComponent();
  27. this.DataContext = new RiskControlNoticeViewModel(riskList);
  28. this.Closing+=RiskControlNoticeView_Closing;
  29. }
  30. public RiskControlNoticeView()
  31. {
  32. InitializeComponent();
  33. this.DataContext = new RiskControlNoticeViewModel();
  34. this.Closing+=RiskControlNoticeView_Closing;
  35. }
  36. void RiskControlNoticeView_Closing(object sender, System.ComponentModel.CancelEventArgs e)
  37. {
  38. e.Cancel = true;
  39. this.WindowState = WindowState.Minimized;
  40. this.Opacity = 0;
  41. }
  42. public void Shows()
  43. {
  44. this.WindowState = WindowState.Normal;
  45. this.Opacity = 1;
  46. }
  47. new public bool? ShowDialog()
  48. {
  49. Shows();
  50. return true;
  51. }
  52. }
  53. }