public StashViewModel(StashView stashView) { this.stashView = stashView; categoryFilter = new List <IFilter>(); AvailableCategories = CategoryManager.GetAvailableCategories(); tabsAndContent = new List <WhatsInTheBox>(); stashView.Loaded += new System.Windows.RoutedEventHandler(stashView_Loaded); GetTabs = new DelegateCommand(GetTabList); ApplicationState.LeagueChanged += new PropertyChangedEventHandler(ApplicationState_LeagueChanged); stashView.tabControl.SelectionChanged += new SelectionChangedEventHandler(tabControl_SelectionChanged); getAvailableItems(); expressionDark = Application.LoadComponent(new Uri("/Procurement;component/Controls/ExpressionDark.xaml", UriKind.RelativeOrAbsolute)) as ResourceDictionary; configuredOrbType = OrbType.Chaos; string currencyDistributionMetric = Settings.UserSettings["CurrencyDistributionMetric"]; if (currencyDistributionMetric.ToLower() == "count") { currencyDistributionUsesCount = true; } else { configuredOrbType = (OrbType)Enum.Parse(typeof(OrbType), currencyDistributionMetric); } }
public void ReloadStash() { Application.Current.Dispatcher.BeginInvoke(DispatcherPriority.Normal, new Action(() => { screens[STASH_VIEW] = new StashView(); SelectedView = screens[STASH_VIEW] as UserControl; ButtonsVisible = true; })); }
public void LoadView(IView view) { Application.Current.Dispatcher.BeginInvoke(DispatcherPriority.Normal, new Action(() => { mainView.MainRegion.Children.Clear(); if (view is StashView) { screens[STASH_VIEW] = new StashView(); } mainView.MainRegion.Children.Add(view as UserControl); })); }
public StashViewModel(StashView stashView) { this.stashView = stashView; categoryFilter = new List <IFilter>(); AvailableCategories = CategoryManager.GetAvailableCategories(); tabsAndContent = new List <TabContent>(); stashView.Loaded += new RoutedEventHandler(stashView_Loaded); ApplicationState.LeagueChanged += new PropertyChangedEventHandler(ApplicationState_LeagueChanged); stashView.tabControl.SelectionChanged += new SelectionChangedEventHandler(tabControl_SelectionChanged); getAvailableItems(); expressionDark = Application.LoadComponent(new Uri("/Procurement;component/Controls/ExpressionDark.xaml", UriKind.RelativeOrAbsolute)) as ResourceDictionary; configuredOrbType = OrbType.Chaos; string currencyDistributionMetric = Settings.UserSettings["CurrencyDistributionMetric"]; if (currencyDistributionMetric.ToLower() == "count") { currencyDistributionUsesCount = true; } else { configuredOrbType = (OrbType)Enum.Parse(typeof(OrbType), currencyDistributionMetric); } if (Settings.UserSettings.Keys.Contains(_enableTabRefreshOnLocationChangedConfigName)) { var enabled = false; if (bool.TryParse(Settings.UserSettings[_enableTabRefreshOnLocationChangedConfigName], out enabled) && enabled) { ClientLogFileWatcher.ClientLogFileChanged -= OnClientLogFileChanged; ClientLogFileWatcher.ClientLogFileChanged += OnClientLogFileChanged; } } }