MainContent.xaml.cs 3.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. using Muchinfo.MTPClient.Data.Enums;
  2. using Muchinfo.MTPClient.Infrastructure.Helpers;
  3. using System;
  4. using System.Windows;
  5. using System.Windows.Controls;
  6. using Muchinfo.MTPClient.Account.Views;
  7. using Muchinfo.MTPClient.Infrastructure.Utilities;
  8. namespace Muchinfo.MTPClient.UI.Views
  9. {
  10. /// <summary>
  11. /// MainContent.xaml 的交互逻辑
  12. /// </summary>
  13. public partial class MainContent : UserControl
  14. {
  15. public MainContent()
  16. {
  17. InitializeComponent();
  18. MessengerHelper.DefaultRegister<TabContetMode>(this, MessengerTokens.ActiveMainRadio, (contentMode) =>
  19. {
  20. this.Dispatcher.BeginInvoke(new Action(() =>
  21. {
  22. switch (contentMode)
  23. {
  24. case TabContetMode.QuoteList:
  25. ////列表报价
  26. QuoteRadioButton.SetValue(Panel.ZIndexProperty, 10);
  27. QuoteRadioButton2.SetValue(Panel.ZIndexProperty, 5);
  28. CandelstickRadioButton.SetValue(Panel.ZIndexProperty, 4);
  29. //GoodsInfoRadioButton.SetValue(Panel.ZIndexProperty, 3);
  30. QuoteListView.Focusable = true;
  31. QuoteListView.Focus();
  32. break;
  33. case TabContetMode.QuoteBoard:
  34. ////大字报价牌
  35. QuoteRadioButton.SetValue(Panel.ZIndexProperty, 10);
  36. QuoteRadioButton2.SetValue(Panel.ZIndexProperty, 20);
  37. CandelstickRadioButton.SetValue(Panel.ZIndexProperty, 4);
  38. //GoodsInfoRadioButton.SetValue(Panel.ZIndexProperty, 3);
  39. break;
  40. case TabContetMode.QuoteChart:
  41. ////图表
  42. QuoteRadioButton.SetValue(Panel.ZIndexProperty, 10);
  43. QuoteRadioButton2.SetValue(Panel.ZIndexProperty, 5);
  44. CandelstickRadioButton.SetValue(Panel.ZIndexProperty, 20);
  45. //GoodsInfoRadioButton.SetValue(Panel.ZIndexProperty, 3);
  46. ChartContentControl.Focusable = true;
  47. ChartContentControl.Focus();
  48. break;
  49. case TabContetMode.QuoteGoodsInfo:
  50. ////商品资料
  51. QuoteRadioButton.SetValue(Panel.ZIndexProperty, 10);
  52. QuoteRadioButton2.SetValue(Panel.ZIndexProperty, 5);
  53. CandelstickRadioButton.SetValue(Panel.ZIndexProperty, 3);
  54. //GoodsInfoRadioButton.SetValue(Panel.ZIndexProperty, 30);
  55. break;
  56. case TabContetMode.HistoryCommissions:
  57. ////五档历史
  58. QuoteRadioButton.SetValue(Panel.ZIndexProperty, 10);
  59. QuoteRadioButton2.SetValue(Panel.ZIndexProperty, 5);
  60. CandelstickRadioButton.SetValue(Panel.ZIndexProperty, 3);
  61. ListingBoardButton.SetValue(Panel.ZIndexProperty, 2);
  62. break;
  63. }
  64. }));
  65. });
  66. this.Loaded += MainContent_Loaded;
  67. }
  68. void MainContent_Loaded(object sender, System.Windows.RoutedEventArgs e)
  69. {
  70. QuoteListView.Focusable = true;
  71. QuoteListView.Focus();
  72. //未修改密码的 且 系统配置首次登录需要修改密码的 则弹出修改密码窗口
  73. if (UserManager.CurrentTradeAccount.HasUpdatedPwd == 0 && SystemParamManager.IsForceModify)
  74. {
  75. MessengerHelper.DefaultSend(false, MessengerTokens.ShowModifyPwd);
  76. }
  77. }
  78. }
  79. }