Exemplo n.º 1
0
        private void homeMenuButton_Click(object sender, RoutedEventArgs e)
        {
            var listfoodScreen = new ListFood();

            listfoodScreen.Show();
            this.Close();
        }
Exemplo n.º 2
0
        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();
            }
        }
Exemplo n.º 3
0
        private void Button_Click_List(object sender, RoutedEventArgs e)
        {
            var listScreen = new ListFood();

            listScreen.Show();
            this.Close();
        }
Exemplo n.º 4
0
        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;
            });
        }