private void homeMenuButton_Click(object sender, RoutedEventArgs e) { var listfoodScreen = new ListFood(); listfoodScreen.Show(); this.Close(); }
private void Window_Loaded(object sender, RoutedEventArgs e) { _list = FoodPreviewDAO.GetAll(); Random _rng = new Random(); int indexRandom = _rng.Next(_list.Count); var folder = AppDomain.CurrentDomain.BaseDirectory; var imagePath = $"{folder}Images\\{_list[indexRandom].ImageNameFile}"; previewImage.Source = new BitmapImage(new Uri(imagePath, UriKind.Absolute)); IntroAccessText.Text = _list[indexRandom].Intro; var isShowSplash = bool.Parse(ConfigurationManager.AppSettings["ShowSplashScreen"]); if (isShowSplash == false) { var listFoodScreen = new ListFood(); listFoodScreen.Show(); this.Close(); } else { timer = new System.Timers.Timer(); timer.Elapsed += Timer_Elapsed; timer.Interval = 1000; timer.Start(); } }
private void Button_Click_List(object sender, RoutedEventArgs e) { var listScreen = new ListFood(); listScreen.Show(); this.Close(); }
private void Timer_Elapsed(object sender, System.Timers.ElapsedEventArgs e) { count++; if (count == target) { timer.Stop(); Dispatcher.Invoke(() => { var listFoodScreen = new ListFood(); listFoodScreen.Show(); this.Close(); }); } Dispatcher.Invoke(() => { splashProgress.Value = count; }); }