diff --git a/Shop1/ShopLogic/PromotionManager.cs b/Shop1/ShopLogic/PromotionManager.cs index 3434be9..ab9f261 100644 --- a/Shop1/ShopLogic/PromotionManager.cs +++ b/Shop1/ShopLogic/PromotionManager.cs @@ -8,7 +8,7 @@ internal class PromotionManager : IPromotionManager { public PromotionManager(IWarehouse warehouse) { - PromotionTimer = new System.Timers.Timer(2000); + PromotionTimer = new System.Timers.Timer(10000); PromotionTimer.Elapsed += GetNewPromotion; PromotionTimer.AutoReset = true; PromotionTimer.Enabled = true; diff --git a/Shop1/ShopPresentation/GraphicalUserInterface/MainWindow.xaml b/Shop1/ShopPresentation/GraphicalUserInterface/MainWindow.xaml index 18765d9..a79c4ae 100644 --- a/Shop1/ShopPresentation/GraphicalUserInterface/MainWindow.xaml +++ b/Shop1/ShopPresentation/GraphicalUserInterface/MainWindow.xaml @@ -35,7 +35,7 @@ - + @@ -62,7 +62,7 @@ - + @@ -72,7 +72,7 @@ - + diff --git a/Shop1/ShopPresentation/PresentationViewModel/MainWindowViewModel.cs b/Shop1/ShopPresentation/PresentationViewModel/MainWindowViewModel.cs index 37a120f..1700bc6 100644 --- a/Shop1/ShopPresentation/PresentationViewModel/MainWindowViewModel.cs +++ b/Shop1/ShopPresentation/PresentationViewModel/MainWindowViewModel.cs @@ -47,7 +47,8 @@ public MainWindowViewModel(ModelAbstractApi modelAbstractApi) BuyButtonClick = new GalaSoft.MvvmLight.Command.RelayCommand(() => BuyButtonClickHandler()); FruitButtonClick = new RelayCommand((id) => FruitButtonClickHandler(id)); - timer.Interval = 2; + timer.Interval = 10000; + timer.Enabled = true; timer.Elapsed += Timer_Elapsed; } @@ -58,8 +59,10 @@ public MainWindowViewModel(ModelAbstractApi modelAbstractApi) private void Timer_Elapsed(object sender, ElapsedEventArgs e) { - Fruits.Clear(); - foreach (FruitDTO fruit in ModelLayer.WarehousePresentation.GetFruits()) + List fruitsInShop = ModelLayer.WarehousePresentation.GetFruits(); + Fruits = new ObservableCollection(); + + foreach (FruitDTO fruit in fruitsInShop) { Fruits.Add(fruit); }