Ejemplo n.º 1
0
        public async Task EditPlayer()
        {
            var playerEditorPage    = new PlayerEditor(this.SelectedPlayer);
            var selectedPlayerIndex = this.PlayerList.IndexOf(this.SelectedPlayer);

            await this.GoToPage(playerEditorPage);

            playerEditorPage.Model().PlayerSaved = async(player) =>
            {
                if (selectedPlayerIndex < 0)
                {
                    this.PlayerList.Add(player);
                }
                else
                {
                    this.PlayerList.RemoveAt(selectedPlayerIndex);
                    this.PlayerList.Insert(selectedPlayerIndex, player);
                }

                await this.ClosePage();

                //await this.GetPlayers();
                //this.PlayerList.Add(player);
            };
        }
Ejemplo n.º 2
0
        public async Task EditPlayer()
        {
            var playerEditorPage = new PlayerEditor(this.SelectedPlayer);

            await this.GoToPage(playerEditorPage);

            playerEditorPage.Model().PlayerSaved = async(player) =>
            {
                await this.ClosePage();

                this.PlayerList.Add(player);
            };
        }