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 listNbPlayer = new List { "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 { } } } }