Ejemplo n.º 1
0
        private void GetBorders(CountryItemViewModel country)
        {
            this.CountryBorders = new ObservableCollection <CountryItemViewModel>();
            foreach (var item in country.Borders)
            {
                foreach (var c in Helper.MyCountries)
                {
                    if (item.Equals(c.Alpha3Code))
                    {
                        var border = new CountryItemViewModel(_navigationService)
                        {
                            Name         = c.Name,
                            Capital      = c.Capital,
                            Region       = c.Region,
                            Subregion    = c.Subregion,
                            Gini         = c.Gini,
                            Area         = c.Area,
                            Population   = c.Population,
                            Flag         = c.Flag,
                            Translations = c.Translations,
                            Currencies   = c.Currencies,
                            Languages    = c.Languages,
                            Borders      = c.Borders,
                            Alpha2Code   = c.Alpha2Code,
                            Alpha3Code   = c.Alpha3Code,
                            Demonym      = c.Demonym
                        };

                        CountryBorders.Add(border);
                    }
                }
            }
        }
Ejemplo n.º 2
0
        private async void SelectCountryAsync()
        {
            this.GetBorders(this);

            this.GeTInfoCovid(this);

            this.CountryCurrencies = this.Currencies;

            this.CountryLanguages = this.Languages;

            this.HasBorders = CountryBorders.Any();

            this.HasNoBorders = !this.HasBorders;

            this.HasNoInfoGovid = !this.HasInfoGovid;

            NavigationParameters parameters = new NavigationParameters
            {
                { "country", this },
            };


            await _navigationService.NavigateAsync(nameof(CountryTabPage), parameters);
        }