You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

60 lines
1.6 KiB

using System;
using System.Collections.Generic;
using System.ComponentModel;
using Xamarin.Forms;
namespace TheGameExtreme.view
{
public partial class GamePreparationPage : ContentPage
{
private string instructionText;
public string InstructionText
{
get { return instructionText; }
set
{
instructionText = value;
OnPropertyChanged("InstructionText");
}
}
public List<string> listNbPlayer = new List<string> { "1", "2", "3", "4", "5" };
public GamePreparationPage()
{
InitializeComponent();
NavigationPage.SetHasNavigationBar(this, false);
Instruction.SetBinding(Label.TextProperty, new Binding("InstructionText", source: this));
InstructionText = AppRessource.StrPlayerSelection;
PlayerSelecter.ItemsSource = listNbPlayer;
}
private async void Back(object sender, EventArgs e)
{
await Navigation.PopAsync();
}
private async void Play(object sender, EventArgs args)
{
await Navigation.PushAsync(new MainPage());
}
private void ChangedPseudo(object sender, EventArgs args)
{
while (NameList.Children.Count != (int)PlayerSelecter.SelectedItem)
if (NameList.Children.Count < (int)PlayerSelecter.SelectedItem)
{
Editor e = new Editor();
e.Placeholder = "Enter your pseudo";
NameList.Children.Add(e);
}
else
{
}
}
}
}