void OnGetRequestTab(string tabName) { if (!TabHeaders.Any(x => x.PageName == tabName)) { return; } var headerInfo = TabHeaders.FirstOrDefault(x => x.PageName == tabName); OnTabItemChecked(headerInfo); }
void Init() { if (AppSettingConfig.Default.AppConfig.MainWindowTabs != null) { AppSettingConfig.Default.AppConfig.MainWindowTabs.ForEach(x => TabHeaders.Add(x)); if (TabHeaders.Any(x => x.IsSelected)) { _selectedTabItem = TabHeaders.FirstOrDefault(x => x.IsSelected); } } TabItemCheckedCommand = new RelayCommand <HeaderInfo>(OnTabItemChecked); PageCommand = new RelayCommand <string>(OnPageCommand); ProgressCommand = new RelayCommand(OnProgressClick); NetWorkCommand = new RelayCommand <bool>(OnNetWorkClick); SetTaskInfos(); RegeistMessenger <string>(OnGetRequestTab); }