Exemplo n.º 1
0
        public async Task <bool> Initialize()
        {
            //var result = await Game.StartGame(puzzle.GameId);
            //if (result.Status != GameStartStatus.Ok)
            //{
            //    var dialog = new MessageDialog("You have already played this game or an error occurred. Please select another one.", "Can't start this game");
            //    await dialog.ShowAsync();
            //    return false;
            //}
            //Image = puzzle.Background;
            //OnPropertyChanged(nameof(Image));
            //puzzle.Word = result.WordToGuess;
            if (string.IsNullOrWhiteSpace(puzzle?.Word))
            {
                return(false);
            }
            Background = await LogicHelper.GetBluredImage(puzzle.GamePhotoNoSplitUrl);

            OnPropertyChanged(nameof(Background));
            resultWord = new ObservableCollection <Cell>();
            for (int i = 0; i < puzzle.Word.Length; i++)
            {
                resultWord.Add(new Cell
                {
                    Letter          = puzzle.Word[i].ToString(),
                    BackgroundColor = new SolidColorBrush(Color.FromArgb(0xff, 0xE4, 0xE4, 0xE4)),
                    ForeColor       = new SolidColorBrush(Color.FromArgb(0xff, 0x47, 0x47, 0x47)),
                });
            }
            LogicHelper.DownloadPhoto(puzzle.GamePhotoNoSplitUrl, PhotoDownloaded);


            OnPropertyChanged(nameof(ResultWord));
            return(true);
        }
Exemplo n.º 2
0
        public async void LoadImage()
        {
            if (imageLoading)
            {
                return;
            }
            imageLoading = true;

            LogicHelper.DownloadPhoto(creatorPhotoUrl, UpdateProfileImage);

            Background = await LogicHelper.GetBluredImage(gamePhotoNoSplitUrl);

            OnPropertyChanged(nameof(Background));
        }