public HomePage()
 {
     InitializeComponent();
     SizeChanged += HomePage_SizeChanged;
     recipeList.LoadAll();
     searchResultList = recipeList;
 }
Ejemplo n.º 2
0
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            var value      = ConfigurationManager.AppSettings["ShowSplashScreen"];
            var showSplash = bool.Parse(value);

            if (showSplash == false)
            {
                var screen = new MainWindow();
                screen.Show();

                this.Close();
            }
            else
            {
                recipeList.LoadAll();
                List <Recipe> temp = recipeList.Recipes;
                int           len  = temp.Count();
                Rerandom : int index = rng.Next(0, len - 1);
                info.Text            = temp[index].Interesting_infomation;
                if (info.Text == "")
                {
                    goto Rerandom;
                }
                timer          = new Timer();
                timer.Elapsed += Timer_Elapsed;
                timer.Interval = 10;
                timer.Start();
            }
        }