using Muchinfo.MTPClient.Data.Enums; using Muchinfo.MTPClient.Infrastructure.Helpers; using System; using System.Windows; using System.Windows.Controls; using Muchinfo.MTPClient.Account.Views; using Muchinfo.MTPClient.Infrastructure.Utilities; namespace Muchinfo.MTPClient.UI.Views { /// /// MainContent.xaml 的交互逻辑 /// public partial class MainContent : UserControl { public MainContent() { InitializeComponent(); MessengerHelper.DefaultRegister(this, MessengerTokens.ActiveMainRadio, (contentMode) => { this.Dispatcher.BeginInvoke(new Action(() => { switch (contentMode) { case TabContetMode.QuoteList: ////列表报价 QuoteRadioButton.SetValue(Panel.ZIndexProperty, 10); QuoteRadioButton2.SetValue(Panel.ZIndexProperty, 5); CandelstickRadioButton.SetValue(Panel.ZIndexProperty, 4); //GoodsInfoRadioButton.SetValue(Panel.ZIndexProperty, 3); QuoteListView.Focusable = true; QuoteListView.Focus(); break; case TabContetMode.QuoteBoard: ////大字报价牌 QuoteRadioButton.SetValue(Panel.ZIndexProperty, 10); QuoteRadioButton2.SetValue(Panel.ZIndexProperty, 20); CandelstickRadioButton.SetValue(Panel.ZIndexProperty, 4); //GoodsInfoRadioButton.SetValue(Panel.ZIndexProperty, 3); break; case TabContetMode.QuoteChart: ////图表 QuoteRadioButton.SetValue(Panel.ZIndexProperty, 10); QuoteRadioButton2.SetValue(Panel.ZIndexProperty, 5); CandelstickRadioButton.SetValue(Panel.ZIndexProperty, 20); //GoodsInfoRadioButton.SetValue(Panel.ZIndexProperty, 3); ChartContentControl.Focusable = true; ChartContentControl.Focus(); break; case TabContetMode.QuoteGoodsInfo: ////商品资料 QuoteRadioButton.SetValue(Panel.ZIndexProperty, 10); QuoteRadioButton2.SetValue(Panel.ZIndexProperty, 5); CandelstickRadioButton.SetValue(Panel.ZIndexProperty, 3); //GoodsInfoRadioButton.SetValue(Panel.ZIndexProperty, 30); break; case TabContetMode.HistoryCommissions: ////五档历史 QuoteRadioButton.SetValue(Panel.ZIndexProperty, 10); QuoteRadioButton2.SetValue(Panel.ZIndexProperty, 5); CandelstickRadioButton.SetValue(Panel.ZIndexProperty, 3); ListingBoardButton.SetValue(Panel.ZIndexProperty, 2); break; } })); }); this.Loaded += MainContent_Loaded; } void MainContent_Loaded(object sender, System.Windows.RoutedEventArgs e) { QuoteListView.Focusable = true; QuoteListView.Focus(); //未修改密码的 且 系统配置首次登录需要修改密码的 则弹出修改密码窗口 if (UserManager.CurrentTradeAccount.HasUpdatedPwd == 0 && SystemParamManager.IsForceModify) { MessengerHelper.DefaultSend(false, MessengerTokens.ShowModifyPwd); } } } }