コード例 #1
0
        public override void OnNavigatedTo(INavigationParameters parameters)
        {
            if (parameters.ContainsKey("anime"))
            {
                anime = parameters.GetValue <AnimeFromModels>("anime");

                GetAnime(anime);
                GetStaff(l_Id);
                GetStats(l_Id);
                GetNews(l_Id);
            }
        }
コード例 #2
0
ファイル: AnimePageViewModel.cs プロジェクト: emrislm/yuiime
        private async void OnAnimeSelected(AnimeFromModels anime)
        {
            if (anime == null)
            {
                return;
            }

            var p = new NavigationParameters();

            p.Add("anime", anime);

            await NavigationService.NavigateAsync(nameof(AnimeDetailsPage), p, true, true);
        }
コード例 #3
0
        // --------------FUNCTIONS--------------
        public async void GetAnime(AnimeFromModels anime)
        {
            L_Id          = anime.L_Id;
            L_Title       = anime.L_Name;
            L_Description = anime.L_Description;
            L_Episodes    = anime.L_Episodes;
            L_Rated       = anime.L_Rated;
            L_Score       = anime.L_Score;

            AnimePictures pictures = await jikan.GetAnimePictures(l_Id);

            L_ImgPath = pictures.Pictures.First().Large;
        }
コード例 #4
0
ファイル: AnimePageViewModel.cs プロジェクト: emrislm/yuiime
        private async void TopAnime()
        {
            IsBusy2 = true;

            AnimeTop topAnimeList = await jikan.GetAnimeTop();

            foreach (var listEntry in topAnimeList.Top)
            {
                tempAnime          = new AnimeFromModels();
                tempAnime.L_Id     = listEntry.MalId;
                tempAnime.L_ImgUrl = listEntry.ImageURL;
                tempAnime.L_Name   = listEntry.Title;
                if (listEntry.Score == null)
                {
                    tempAnime.L_Score = "No";
                }
                else
                {
                    tempAnime.L_Score = Convert.ToString(listEntry.Score);
                }
                if (listEntry.Episodes == null)
                {
                    tempAnime.L_Episodes = "No";
                }
                else
                {
                    tempAnime.L_Episodes = Convert.ToString(listEntry.Episodes);
                }
                tempAnime.L_Description = "No discription :/";
                tempAnime.L_Rated       = "No Rating :/";

                TopAnimes.Add(tempAnime);

                if (listEntry.Score >= 8)
                {
                    tempAnime.L_ScoreTextColor = "LawnGreen";
                }
                else if (listEntry.Score >= 5)
                {
                    tempAnime.L_ScoreTextColor = "Orange";
                }
                else
                {
                    tempAnime.L_ScoreTextColor = "Red";
                }
            }
            TopAnimeLabel = "Best of the Best";

            IsBusy2 = false;
        }
コード例 #5
0
ファイル: AnimePageViewModel.cs プロジェクト: emrislm/yuiime
        private async void LatestAnime()
        {
            IsBusy2 = true;

            Season season = await jikan.GetSeason();

            foreach (var seasonEntry in season.SeasonEntries)
            {
                tempAnime          = new AnimeFromModels();
                tempAnime.L_Id     = seasonEntry.MalId;
                tempAnime.L_ImgUrl = seasonEntry.ImageURL;
                tempAnime.L_Name   = seasonEntry.Title;
                if (seasonEntry.Score == null)
                {
                    tempAnime.L_Score = "--";
                }
                else
                {
                    tempAnime.L_Score = Convert.ToString(seasonEntry.Score);
                }
                if (seasonEntry.Episodes == null)
                {
                    tempAnime.L_Episodes = "--";
                }
                tempAnime.L_Description = seasonEntry.Synopsis;
                tempAnime.L_Rated       = seasonEntry.Type;

                LatestAnimes.Add(tempAnime);

                if (seasonEntry.Score >= 8)
                {
                    tempAnime.L_ScoreTextColor = "LawnGreen";
                }
                else if (seasonEntry.Score >= 5)
                {
                    tempAnime.L_ScoreTextColor = "Orange";
                }
                else
                {
                    tempAnime.L_ScoreTextColor = "Red";
                }
            }
            SeasonLabel = "Latest";

            IsBusy2 = false;
        }