diff --git a/Procurement/ViewModel/ScreenController.cs b/Procurement/ViewModel/ScreenController.cs index b6c02602..29f6f422 100644 --- a/Procurement/ViewModel/ScreenController.cs +++ b/Procurement/ViewModel/ScreenController.cs @@ -167,7 +167,6 @@ public void ReloadStash() Application.Current.Dispatcher.BeginInvoke(DispatcherPriority.Normal, new Action(() => { - screens[STASH_VIEW] = new StashView(); SelectedView = screens[STASH_VIEW] as UserControl; ButtonsVisible = true; })); diff --git a/Procurement/ViewModel/TabViewModel/StashViewModel.cs b/Procurement/ViewModel/TabViewModel/StashViewModel.cs index 77c3b1be..d93e60db 100644 --- a/Procurement/ViewModel/TabViewModel/StashViewModel.cs +++ b/Procurement/ViewModel/TabViewModel/StashViewModel.cs @@ -252,7 +252,6 @@ void tabControl_SelectionChanged(object sender, SelectionChangedEventArgs e) var item = stashView.tabControl.SelectedItem as TabItem; selectedTab = item; Image i = item.Header as Image; - CroppedBitmap bm = (CroppedBitmap)i.Source; Tab tab = (Tab)i.Tag; item.Header = StashHelper.GenerateTabImage(tab, true); } @@ -266,6 +265,8 @@ private void unselectPreviousTab(TabItem selectedTab) void ApplicationState_LeagueChanged(object sender, PropertyChangedEventArgs e) { + tabsAndContent.Clear(); + getAvailableItems(); stashView.tabControl.SelectionChanged -= new SelectionChangedEventHandler(tabControl_SelectionChanged); stashView.tabControl.Items.Clear(); @@ -339,9 +340,9 @@ private void closeAndSelect(ContextMenu menu, MenuItem menuItem) void stashView_Loaded(object sender, RoutedEventArgs e) { + var stash = ApplicationState.Stash[ApplicationState.CurrentLeague]; for (var i = 1; i <= ApplicationState.Stash[ApplicationState.CurrentLeague].NumberOfTabs; i++) { - var stash = ApplicationState.Stash[ApplicationState.CurrentLeague]; var currentTab = stash.Tabs[i - 1]; var item = new TabItem