Exemplo n.º 1
0
        private void SetName(object sender, RoutedEventArgs e)
        {
            if (NamePlayer.Text.Length == 0)
            {
                return;
            }
            config.SetPlayerName(NamePlayer.Text);
            win.EnableTimer = (Boolean)EnableTimer.IsChecked;
            switch (config.GetLevel())
            {
            case "1":
                View.RedirectUrl("FirstLevel.xaml");
                break;

            case "2":
                View.RedirectUrl("SecondLevel.xaml");
                break;

            case "3":
                View.RedirectUrl("ThirdLevel.xaml");
                break;

            default: break;
            }
            var w = Application.Current.Windows.OfType <MainWindow>().First();

            w.Player.Text += config.GetPlayerName();
        }
Exemplo n.º 2
0
 public Midlle()
 {
     InitializeComponent();
     View       = new ViewManagment();
     config     = new ConfigMethods();
     win        = Application.Current.Windows.OfType <MainWindow>().First();
     Score.Text = win.Score.ToString();
     if (config.GetLevel() == "3")
     {
         NextLevelBtn.Visibility = Visibility.Collapsed;
     }
     DataBase.SetData(Score.Text);
 }
Exemplo n.º 3
0
 private void ChangeLevel(object sender, RoutedEventArgs e)
 {
     Timer.Stop();
     Levels.Visibility = Visibility.Visible;
     foreach (var item in Levels.Children)
     {
         (item as Button).IsEnabled  = true;
         (item as Button).Background = new SolidColorBrush(Color.FromRgb(221, 221, 221));
         if ((item as Button).Content.ToString() == config.GetLevel())
         {
             (item as Button).IsEnabled  = false;
             (item as Button).Background = new SolidColorBrush(Colors.Tomato);
         }
     }
 }
Exemplo n.º 4
0
        private void NextLevel(object sender, RoutedEventArgs e)
        {
            switch (config.GetLevel())
            {
            case "1":
                View.RedirectUrl("SecondLevel.xaml");
                break;

            case "2":
                View.RedirectUrl("ThirdLevel.xaml");
                break;

            case "3": break;

            default: break;
            }
        }