private void ViewModel_LoadCompleted()
        {
            LoadRing.IsActive = false;

            FadeInContent.Begin();

            Scroller.VerticalScrollBarVisibility = ScrollBarVisibility.Auto;
        }
        private void ViewModel_LoadCompleted()
        {
            if (ViewModel.Collection.overview is null || ViewModel.Collection.overview.Equals(""))
            {
                overview.Visibility = Windows.UI.Xaml.Visibility.Collapsed;
            }
            if (ViewModel.Posters.Count == 0)
            {
                pivot.Items.Remove(posterspivot);
            }

            if (ViewModel.Backdrops.Count == 0)
            {
                pivot.Items.Remove(backdropspivot);
            }

            LoadRing.IsActive = false;
            FadeInContent.Begin();
        }
        private async void ViewModel_LoadedMore()
        {
            if (ViewModel.Movies.Count == 0)
            {
                pivot.Items.Remove(moviespivot);
            }
            if (ViewModel.Shows.Count == 0)
            {
                pivot.Items.Remove(showspivot);
            }
            if (ViewModel.People.Count == 0)
            {
                pivot.Items.Remove(peoplepivot);
            }

            LoadRing.IsActive = false;
            FadeInContent.Begin();
            if (Scroller.ScrollableHeight == 0)
            {
                await ViewModel.LoadData();
            }
        }
Beispiel #4
0
        private void ViewModel_LoadCompleted()
        {
            if (ViewModel.Person.known_for_department != null)
            {
                department.Text = ViewModel.Person.known_for_department;
            }

            if (ViewModel.Person.gender == 1)
            {
                gender.Text = new ResourceLoader().GetString("Female");
            }
            else if (ViewModel.Person.gender == 2)
            {
                gender.Text = new ResourceLoader().GetString("Male");
            }

            if (ViewModel.Person.birthday != null)
            {
                birthday.Text = DateTime.Parse(ViewModel.Person.birthday).ToString("yyyy. MM. dd.");
                age.Text      = Math.Floor((DateTime.Now - DateTime.Parse(ViewModel.Person.birthday)).Days / 365.2425) + " " + new ResourceLoader().GetString("Years");
            }

            if (ViewModel.Person.deathday != null)
            {
                deathday.Text           = DateTime.Parse(ViewModel.Person.deathday).ToString("yyyy. MM. dd.");
                ageinfo.Visibility      = Windows.UI.Xaml.Visibility.Collapsed;
                deathdayinfo.Visibility = Windows.UI.Xaml.Visibility.Visible;
            }

            if (ViewModel.Person.place_of_birth != null)
            {
                birthplace.Text = ViewModel.Person.place_of_birth;
            }

            if (ViewModel.Person.biography is null || ViewModel.Person.biography.Equals(""))
            {
                biography.Visibility = Windows.UI.Xaml.Visibility.Collapsed;
            }
            if (ViewModel.Person.homepage is null || ViewModel.Person.homepage.Equals(""))
            {
                homepageicon.Visibility = Windows.UI.Xaml.Visibility.Collapsed;
            }
            if (ViewModel.Person.imdb_id is null || ViewModel.Person.imdb_id.Equals(""))
            {
                imdbicon.Visibility = Windows.UI.Xaml.Visibility.Collapsed;
            }
            if (ViewModel.Person.external_ids.facebook_id is null || ViewModel.Person.external_ids.facebook_id.Equals(""))
            {
                facebookicon.Visibility = Windows.UI.Xaml.Visibility.Collapsed;
            }
            if (ViewModel.Person.external_ids.twitter_id is null || ViewModel.Person.external_ids.twitter_id.Equals(""))
            {
                twittericon.Visibility = Windows.UI.Xaml.Visibility.Collapsed;
            }
            if (ViewModel.Person.external_ids.instagram_id is null || ViewModel.Person.external_ids.instagram_id.Equals(""))
            {
                instagramicon.Visibility = Windows.UI.Xaml.Visibility.Collapsed;
            }

            if (ViewModel.Movies.Count == 0)
            {
                pivot.Items.Remove(moviespivot);
            }
            if (ViewModel.Shows.Count == 0)
            {
                pivot.Items.Remove(showspivot);
            }
            if (ViewModel.Images.Count == 0)
            {
                pivot.Items.Remove(imagespivot);
            }

            LoadRing.IsActive = false;
            FadeInContent.Begin();
        }
Beispiel #5
0
        private void ViewModel_LoadCompleted()
        {
            year.Text = ViewModel.Movie.release_date.Split('-')[0];

            var iso = TMDBService.region;

            foreach (var v in ViewModel.Movie.release_dates.results)
            {
                if (v.iso_3166_1.Equals(iso))
                {
                    if (!v.release_dates[v.release_dates.Count - 1].certification.Equals(""))
                    {
                        certification.Text = v.release_dates[v.release_dates.Count - 1].certification;
                    }
                    break;
                }
            }

            if (ViewModel.Movie.runtime != 0)
            {
                if (ViewModel.Movie.runtime > 60)
                {
                    runtime.Text = $"{ViewModel.Movie.runtime / 60} {new ResourceLoader().GetString("Hour")} {ViewModel.Movie.runtime % 60} {new ResourceLoader().GetString("Minute")}";
                }
                else
                {
                    runtime.Text = $"{ViewModel.Movie.runtime} {new ResourceLoader().GetString("Minute")}";
                }
            }

            var vote = Math.Round((double)ViewModel.Movie.vote_average / 2, 2);

            voteaverage.PlaceholderValue = vote;
            votecount.Text = $"{ViewModel.Movie.vote_average:0.0}";
            ToolTipService.SetToolTip(votecount, new ToolTip()
            {
                Content = $"{ViewModel.Movie.vote_count} {new ResourceLoader().GetString("Votes")}"
            });

            if (!ViewModel.Movie.release_date.Equals(""))
            {
                releasedate.Text = DateTime.Parse(ViewModel.Movie.release_date).ToString("yyyy. MM. dd.");
            }

            director.ItemTemplateSelector = new MyTemplateSelector()
            {
                CommonTemplate = CommonDataTemplate,
                LastTemplate   = LastDataTemplate
            };

            if (ViewModel.Movie.belongs_to_collection is null)
            {
                collectioninfo.Visibility = Windows.UI.Xaml.Visibility.Collapsed;
            }
            else
            {
                collection.Text = ViewModel.Movie.belongs_to_collection.name;
            }

            var prodcompanies = "";

            foreach (var v in ViewModel.Movie.production_companies)
            {
                if (!v.name.Equals(""))
                {
                    prodcompanies += v.name + ", ";
                }
            }
            if (!prodcompanies.Equals(""))
            {
                companies.Text = prodcompanies.Substring(0, prodcompanies.Length - 2);
            }

            var prodcountries = "";

            foreach (var v in ViewModel.Movie.production_countries)
            {
                if (!v.name.Equals(""))
                {
                    prodcountries += v.name + ", ";
                }
            }
            if (!prodcountries.Equals(""))
            {
                countries.Text = prodcountries.Substring(0, prodcountries.Length - 2);
            }

            var spokenlangs = "";

            foreach (var v in ViewModel.Movie.spoken_languages)
            {
                if (!v.name.Equals(""))
                {
                    spokenlangs += v.name + ", ";
                }
            }
            if (!spokenlangs.Equals(""))
            {
                languages.Text = spokenlangs.Substring(0, spokenlangs.Length - 2);
            }

            if (ViewModel.Movie.budget != 0)
            {
                budget.Text = "$" + ViewModel.Movie.budget.ToString("N0");
            }
            if (ViewModel.Movie.revenue != 0)
            {
                revenue.Text = "$" + ViewModel.Movie.revenue.ToString("N0");
            }
            if (ViewModel.Movie.tagline is null || ViewModel.Movie.tagline.Equals(""))
            {
                tagline.Visibility = Windows.UI.Xaml.Visibility.Collapsed;
            }
            if (ViewModel.Movie.overview is null || ViewModel.Movie.overview.Equals(""))
            {
                overview.Visibility = Windows.UI.Xaml.Visibility.Collapsed;
            }
            if (ViewModel.Movie.homepage is null || ViewModel.Movie.homepage.Equals(""))
            {
                homepageicon.Visibility = Windows.UI.Xaml.Visibility.Collapsed;
            }
            if (ViewModel.Movie.imdb_id is null || ViewModel.Movie.imdb_id.Equals(""))
            {
                imdbicon.Visibility = Windows.UI.Xaml.Visibility.Collapsed;
            }
            if (ViewModel.Movie.external_ids.facebook_id is null || ViewModel.Movie.external_ids.facebook_id.Equals(""))
            {
                facebookicon.Visibility = Windows.UI.Xaml.Visibility.Collapsed;
            }
            if (ViewModel.Movie.external_ids.twitter_id is null || ViewModel.Movie.external_ids.twitter_id.Equals(""))
            {
                twittericon.Visibility = Windows.UI.Xaml.Visibility.Collapsed;
            }
            if (ViewModel.Movie.external_ids.instagram_id is null || ViewModel.Movie.external_ids.instagram_id.Equals(""))
            {
                instagramicon.Visibility = Windows.UI.Xaml.Visibility.Collapsed;
            }

            if (ViewModel.Cast.Count == 0)
            {
                pivot.Items.Remove(castpivot);
            }
            if (ViewModel.Crew.Count == 0)
            {
                pivot.Items.Remove(crewpivot);
            }
            if (ViewModel.Videos.Count == 0)
            {
                pivot.Items.Remove(videospivot);
            }
            if (ViewModel.Backdrops.Count == 0)
            {
                pivot.Items.Remove(backdropspivot);
            }
            if (ViewModel.Recommendations.Count == 0)
            {
                pivot.Items.Remove(recommendationspivot);
            }
            if (ViewModel.Similar.Count == 0)
            {
                pivot.Items.Remove(similarpivot);
            }
            //if (ViewModel.Torrents.Count == 0) pivot.Items.Remove(torrentspivot);
            if (ViewModel.Movie.keywords.keywords.Count == 0)
            {
                keywordsinfo.Visibility = Windows.UI.Xaml.Visibility.Collapsed;
            }

            LoadRing.IsActive = false;
            FadeInContent.Begin();
        }
        private void ViewModel_LoadCompleted()
        {

            if(ViewModel.Show.first_air_date != null)
            {
                firstairdate.Text = DateTime.Parse(ViewModel.Show.first_air_date).ToString("yyyy. MM. dd.");
                year.Text = ViewModel.Show.first_air_date.Split('-')[0];
                if (ViewModel.Show.last_air_date != null)
                {
                    lastairdate.Text = DateTime.Parse(ViewModel.Show.last_air_date).ToString("yyyy. MM. dd.");
                    if (!ViewModel.Show.in_production)
                        year.Text += "-" + ViewModel.Show.last_air_date.Split('-')[0];
                }
                
            }

            if(ViewModel.Show.episode_run_time.Count != 0) runtime.Text = ViewModel.Show.episode_run_time[0].ToString() + " " + new ResourceLoader().GetString("Minute");
            seasons.Text = ViewModel.Show.number_of_seasons + " " + new ResourceLoader().GetString("Seasonnumber");
            episodes.Text = ViewModel.Show.number_of_episodes + " " + new ResourceLoader().GetString("Episodenumber");

            var iso = TMDBService.region;
            foreach (var v in ViewModel.Show.content_ratings.results)
            {
                if (v.iso_3166_1.Equals(iso))
                {
                    certification.Text = v.rating;
                    break;
                }
            }

            var vote = Math.Round((double)ViewModel.Show.vote_average / 2, 2);
            voteaverage.PlaceholderValue = vote;
            votecount.Text = $"{ViewModel.Show.vote_average:0.0}";
            ToolTipService.SetToolTip(votecount, new ToolTip() { Content = $"{ViewModel.Show.vote_count} {new ResourceLoader().GetString("Votes")}" });

            creator.ItemTemplateSelector = new MyTemplateSelector()
            {
                CommonTemplate = CommonDataTemplate,
                LastTemplate = LastDataTemplate
            };

            network.ItemTemplateSelector = new MyTemplateSelector()
            {
                CommonTemplate = CommonNetworkDataTemplate,
                LastTemplate = LastNetworkDataTemplate
            };

            var prodcompanies = "";
            foreach (var v in ViewModel.Show.production_companies)
            {
                if (!v.name.Equals("")) prodcompanies += v.name + ", ";
            }
            if (!prodcompanies.Equals("")) companies.Text = prodcompanies.Substring(0, prodcompanies.Length - 2);

            var origincountries = "";
            foreach (var v in ViewModel.Show.origin_country)
            {
                origincountries += v + ", ";
            }
            if (!origincountries.Equals("")) countries.Text = origincountries.Substring(0, origincountries.Length - 2);

            if (ViewModel.Show.overview is null || ViewModel.Show.overview.Equals("")) overview.Visibility = Windows.UI.Xaml.Visibility.Collapsed;
            if (ViewModel.Show.homepage is null || ViewModel.Show.homepage.Equals("")) homepageicon.Visibility = Windows.UI.Xaml.Visibility.Collapsed;
            if (ViewModel.Show.external_ids.imdb_id is null || ViewModel.Show.external_ids.imdb_id.Equals("")) imdbicon.Visibility = Windows.UI.Xaml.Visibility.Collapsed;
            if (ViewModel.Show.external_ids.facebook_id is null || ViewModel.Show.external_ids.facebook_id.Equals("")) facebookicon.Visibility = Windows.UI.Xaml.Visibility.Collapsed;
            if (ViewModel.Show.external_ids.twitter_id is null || ViewModel.Show.external_ids.twitter_id.Equals("")) twittericon.Visibility = Windows.UI.Xaml.Visibility.Collapsed;
            if (ViewModel.Show.external_ids.instagram_id is null || ViewModel.Show.external_ids.instagram_id.Equals("")) instagramicon.Visibility = Windows.UI.Xaml.Visibility.Collapsed;

            if (ViewModel.Show.seasons.Count == 0) pivot.Items.Remove(seasonspivot);
            if (ViewModel.Cast.Count == 0) pivot.Items.Remove(castpivot);
            if (ViewModel.Crew.Count == 0) pivot.Items.Remove(crewpivot);
            if (ViewModel.Videos.Count == 0) pivot.Items.Remove(videospivot);
            if (ViewModel.Backdrops.Count == 0) pivot.Items.Remove(backdropspivot);
            if (ViewModel.Recommendations.Count == 0) pivot.Items.Remove(recommendationspivot);
            if (ViewModel.Similar.Count == 0) pivot.Items.Remove(similarpivot);
            if (ViewModel.Show.keywords.results.Count == 0) keywordsinfo.Visibility = Windows.UI.Xaml.Visibility.Collapsed;

            LoadRing.IsActive = false;
            FadeInContent.Begin();
        }