Beispiel #1
0
        public override async Task Init(Guid meetingId)
        {
            await NavService.PushAlertPopupAsync("Loading...");

            Meeting = await DataRetrievalService.GetMeetingOrNullAsync(meetingId);

            if (Meeting != null)
            {
                var players = await DataRetrievalService.GetMeetingAttendeesAsync(meetingId);

                List <PlayerViewModel> playerVms = new List <PlayerViewModel>();
                foreach (var p in players)
                {
                    playerVms.Add(new PlayerViewModel()
                    {
                        PlayerName = $"{p.User_UserId.FirstName}  {p.User_UserId.LastName.Substring(0, 1)}.",
                        Score      = 0 //TODO: need to wire this up
                    });
                }
                Players = playerVms;
                RaisePropertyChanged(nameof(Players));

                BingoInstance = await DataRetrievalService.GetCurrentBingoInstanceOrNullAsync(meetingId);

                if (BingoInstance == null)
                {
                    //we need to make a new instance of this meeting, and make new content too
                    BingoInstance = await DataRetrievalService.CreateNewBingoInstance(meetingId);
                }

                BingoInstanceContent = await DataRetrievalService.GetBingoInstanceContentAsync(BingoInstance.BingoInstanceId);

                RaisePropertyChanged(nameof(BingoInstanceContent));
            }

            await NavService.PopAlertPopupsAsync();
        }